]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
Moving UPDATE defines/constants out of boot
[friendica.git] / boot.php
index 7fb87ca4eb4391d9c5086c7eefdcf0b2e105b7a1..efff5baffa818145277d0bfe7d8ef0963b1c8f1d 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -28,9 +28,9 @@ use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
 use Friendica\Core\Protocol;
 use Friendica\Core\System;
+use Friendica\Core\Update;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
-use Friendica\Database\DBStructure;
 use Friendica\Model\Contact;
 use Friendica\Model\Conversation;
 use Friendica\Util\DateTimeFormat;
@@ -43,13 +43,6 @@ define('FRIENDICA_VERSION',      '2018.12-dev');
 define('DFRN_PROTOCOL_VERSION',  '2.23');
 define('NEW_UPDATE_ROUTINE_VERSION', 1170);
 
-/**
- * @brief Constants for the database update check
- */
-const DB_UPDATE_NOT_CHECKED = 0; // Database check wasn't executed before
-const DB_UPDATE_SUCCESSFUL = 1;  // Database check was successful
-const DB_UPDATE_FAILED = 2;      // Database check failed
-
 /**
  * @brief Constant with a HTML line break.
  *
@@ -106,20 +99,6 @@ define('SSL_POLICY_FULL',         1);
 define('SSL_POLICY_SELFSIGN',     2);
 /* @}*/
 
-/**
- * @name Logger
- *
- * log levels
- * @{
- */
-define('LOGGER_WARNING',         0);
-define('LOGGER_INFO',            1);
-define('LOGGER_TRACE',           2);
-define('LOGGER_DEBUG',           3);
-define('LOGGER_DATA',            4);
-define('LOGGER_ALL',             5);
-/* @}*/
-
 /**
  * @name Register
  *
@@ -133,18 +112,6 @@ define('REGISTER_OPEN',          2);
  * @}
 */
 
-/**
- * @name Update
- *
- * DB update return values
- * @{
- */
-define('UPDATE_SUCCESS', 0);
-define('UPDATE_FAILED',  1);
-/**
- * @}
- */
-
 /**
  * @name CP
  *
@@ -468,7 +435,7 @@ function check_db($via_worker)
        if ($build < DB_UPDATE_VERSION) {
                // When we cannot execute the database update via the worker, we will do it directly
                if (!Worker::add(PRIORITY_CRITICAL, 'DBUpdate') && $via_worker) {
-                       update_db();
+                       Update::run();
                }
        }
 }
@@ -1069,45 +1036,3 @@ function validate_include(&$file)
        // Simply return flag
        return $valid;
 }
-
-/**
- * @brief Get the data which is needed for infinite scroll
- *
- * For invinite scroll we need the page number of the actual page
- * and the the URI where the content of the next page comes from.
- * This data is needed for the js part in main.js.
- * Note: infinite scroll does only work for the network page (module)
- *
- * @param string $module The name of the module (e.g. "network")
- * @return array Of infinite scroll data
- *     'pageno' => $pageno The number of the actual page
- *     'reload_uri' => $reload_uri The URI of the content we have to load
- */
-function infinite_scroll_data($module)
-{
-       if (PConfig::get(local_user(), 'system', 'infinite_scroll')
-               && $module == 'network'
-               && defaults($_GET, 'mode', '') != 'minimal'
-       ) {
-               // get the page number
-               $pageno = defaults($_GET, 'page', 1);
-
-               $reload_uri = "";
-
-               // try to get the uri from which we load the content
-               foreach ($_GET as $param => $value) {
-                       if (($param != "page") && ($param != "q")) {
-                               $reload_uri .= "&" . $param . "=" . urlencode($value);
-                       }
-               }
-
-               $a = get_app();
-               if ($a->page_offset != "" && !strstr($reload_uri, "&offset=")) {
-                       $reload_uri .= "&offset=" . urlencode($a->page_offset);
-               }
-
-               $arr = ["pageno" => $pageno, "reload_uri" => $reload_uri];
-
-               return $arr;
-       }
-}