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;
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
*
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();
}
}
}
// 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;
- }
-}