]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
Merge pull request #4060 from annando/system-unavailable
[friendica.git] / boot.php
index 8492701a0c2db1ff9b97d9d2d42f7db4376ab955..d9a64e570ac49cf6f919eac570b4ecc4908f53c4 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -27,7 +27,7 @@ use Friendica\Core\Config;
 use Friendica\Core\PConfig;
 use Friendica\Core\Worker;
 use Friendica\Database\DBM;
-use Friendica\Util\Lock;
+use Friendica\Model\Contact;
 
 require_once 'include/network.php';
 require_once 'include/plugin.php';
@@ -35,17 +35,15 @@ require_once 'include/text.php';
 require_once 'include/datetime.php';
 require_once 'include/pgettext.php';
 require_once 'include/nav.php';
-require_once 'include/features.php';
 require_once 'include/identity.php';
 require_once 'update.php';
 require_once 'include/dbstructure.php';
-require_once 'include/poller.php';
 
 define('FRIENDICA_PLATFORM',     'Friendica');
 define('FRIENDICA_CODENAME',     'Asparagus');
 define('FRIENDICA_VERSION',      '3.6-dev');
 define('DFRN_PROTOCOL_VERSION',  '2.23');
-define('DB_UPDATE_VERSION',      1235);
+define('DB_UPDATE_VERSION',      1236);
 
 /**
  * @brief Constant with a HTML line break.
@@ -254,25 +252,24 @@ define('PROTOCOL_SPLITTED_CONV',   6);
  * @{
  */
 define('NETWORK_DFRN',             'dfrn');    // Friendica, Mistpark, other DFRN implementations
-define('NETWORK_ZOT',              'zot!');    // Zot!
-define('NETWORK_OSTATUS',          'stat');    // status.net, identi.ca, GNU-social, other OStatus implementations
+define('NETWORK_ZOT',              'zot!');    // Zot! - Currently unsupported
+define('NETWORK_OSTATUS',          'stat');    // GNU-social, Pleroma, Mastodon, other OStatus implementations
 define('NETWORK_FEED',             'feed');    // RSS/Atom feeds with no known "post/notify" protocol
 define('NETWORK_DIASPORA',         'dspr');    // Diaspora
 define('NETWORK_MAIL',             'mail');    // IMAP/POP
-define('NETWORK_MAIL2',            'mai2');    // extended IMAP/POP
 define('NETWORK_FACEBOOK',         'face');    // Facebook API
 define('NETWORK_LINKEDIN',         'lnkd');    // LinkedIn
-define('NETWORK_XMPP',             'xmpp');    // XMPP
-define('NETWORK_MYSPACE',          'mysp');    // MySpace
+define('NETWORK_XMPP',             'xmpp');    // XMPP - Currently unsupported
+define('NETWORK_MYSPACE',          'mysp');    // MySpace - Currently unsupported
 define('NETWORK_GPLUS',            'goog');    // Google+
 define('NETWORK_PUMPIO',           'pump');    // pump.io
 define('NETWORK_TWITTER',          'twit');    // Twitter
 define('NETWORK_DIASPORA2',        'dspc');    // Diaspora connector
 define('NETWORK_STATUSNET',        'stac');    // Statusnet connector
-define('NETWORK_APPNET',           'apdn');    // app.net
-define('NETWORK_NEWS',             'nntp');    // Network News Transfer Protocol
-define('NETWORK_ICALENDAR',        'ical');    // iCalendar
-define('NETWORK_PNUT',             'pnut');    // pnut.io
+define('NETWORK_APPNET',           'apdn');    // app.net - Dead protocol
+define('NETWORK_NEWS',             'nntp');    // Network News Transfer Protocol - Currently unsupported
+define('NETWORK_ICALENDAR',        'ical');    // iCalendar - Currently unsupported
+define('NETWORK_PNUT',             'pnut');    // pnut.io - Currently unsupported
 define('NETWORK_PHANTOM',          'unkn');    // Place holder
 /**
  * @}
@@ -290,7 +287,6 @@ $netgroup_ids = array(
        NETWORK_FEED     => (-4),
        NETWORK_DIASPORA => (-5),
        NETWORK_MAIL     => (-6),
-       NETWORK_MAIL2    => (-7),
        NETWORK_FACEBOOK => (-8),
        NETWORK_LINKEDIN => (-9),
        NETWORK_XMPP     => (-10),
@@ -414,7 +410,6 @@ define('ACTIVITY_SHARE',       NAMESPACE_ACTIVITY_SCHEMA . 'share');
 define('ACTIVITY_DELETE',      NAMESPACE_ACTIVITY_SCHEMA . 'delete');
 
 define('ACTIVITY_POKE',        NAMESPACE_ZOT . '/activity/poke');
-define('ACTIVITY_MOOD',        NAMESPACE_ZOT . '/activity/mood');
 
 define('ACTIVITY_OBJ_BOOKMARK', NAMESPACE_ACTIVITY_SCHEMA . 'bookmark');
 define('ACTIVITY_OBJ_COMMENT', NAMESPACE_ACTIVITY_SCHEMA . 'comment');
@@ -568,16 +563,6 @@ function x($s, $k = null)
        }
 }
 
-/**
- * @brief Called from db initialisation if db is dead.
- */
-function system_unavailable()
-{
-       include 'system_unavailable.php';
-       system_down();
-       killme();
-}
-
 /**
  * @brief Returns the baseurl.
  *
@@ -619,7 +604,7 @@ function is_ajax()
 /**
  * @brief Function to check if request was an AJAX (xmlhttprequest) request.
  *
- * @param boolean $via_worker boolean Is the check run via the poller?
+ * @param boolean $via_worker boolean Is the check run via the worker?
  */
 function check_db($via_worker)
 {
@@ -630,7 +615,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) {
+               if (!Worker::add(PRIORITY_CRITICAL, 'DBUpdate') && $via_worker) {
                        update_db(get_app());
                }
        }
@@ -689,7 +674,7 @@ function update_db(App $a)
                                // Compare the current structure with the defined structure
 
                                $t = Config::get('database', 'dbupdate_' . DB_UPDATE_VERSION);
-                               if ($t !== false) {
+                               if (!is_null($t)) {
                                        return;
                                }
 
@@ -745,7 +730,7 @@ function run_update_function($x)
                // delete the config entry to try again.
 
                $t = Config::get('database', 'update_' . $x);
-               if ($t !== false) {
+               if (!is_null($t)) {
                        return false;
                }
                Config::set('database', 'update_' . $x, time());
@@ -984,10 +969,10 @@ function public_contact()
        if (!$public_contact_id && x($_SESSION, 'authenticated')) {
                if (x($_SESSION, 'my_address')) {
                        // Local user
-                       $public_contact_id = intval(get_contact($_SESSION['my_address'], 0));
+                       $public_contact_id = intval(Contact::getIdForURL($_SESSION['my_address'], 0));
                } elseif (x($_SESSION, 'visitor_home')) {
                        // Remote user
-                       $public_contact_id = intval(get_contact($_SESSION['visitor_home'], 0));
+                       $public_contact_id = intval(Contact::getIdForURL($_SESSION['visitor_home'], 0));
                }
        } elseif (!x($_SESSION, 'authenticated')) {
                $public_contact_id = false;
@@ -1065,18 +1050,6 @@ function get_max_import_size()
        return ((x($a->config, 'max_import_size')) ? $a->config['max_import_size'] : 0 );
 }
 
-/**
- * @brief compatibilty wrapper for Worker::add function
- *
- * @param (integer|array) priority or parameter array, strings are deprecated and are ignored
- *
- * @return boolean "false" if proc_run couldn't be executed
- */
-function proc_run()
-{
-       $proc_args = func_get_args();
-       call_user_func_array('Friendica\Core\Worker::add', $proc_args);
-}
 
 function current_theme()
 {