X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=8f25c2b93163261268fa889d1742fecd57324dc0;hb=5790a0c58a5d044c9c0cba8496db07fa7d0bc0b6;hp=bececa9470f19a2a6601c91339b8629d70d7b0c9;hpb=2503660f97c3f9588f1965c23b98d0c78109ee0b;p=friendica.git diff --git a/boot.php b/boot.php index bececa9470..8f25c2b931 100644 --- a/boot.php +++ b/boot.php @@ -508,14 +508,7 @@ if (!defined('CURLE_OPERATION_TIMEDOUT')) { */ function get_app() { - global $a; - - if (empty($a)) { - $a = new App(dirname(__DIR__)); - BaseObject::setApp($a); - } - - return $a; + return BaseObject::getApp(); } /** @@ -781,7 +774,7 @@ function run_update_function($x) /** * @brief Synchronise addons: * - * $a->config['system']['addon'] contains a comma-separated list of names + * system.addon contains a comma-separated list of names * of addons which are used on this system. * Go through the database list of already installed addons, and if we have * an entry, but it isn't in the config list, call the uninstall procedure @@ -964,17 +957,6 @@ function info($s) } } -/** - * @brief Wrapper around config to limit the text length of an incoming message - * - * @return int - */ -function get_max_import_size() -{ - $a = get_app(); - return (x($a->config, 'max_import_size') ? $a->config['max_import_size'] : 0); -} - function feed_birthday($uid, $tz) { /** @@ -1030,14 +1012,11 @@ function is_site_admin() { $a = get_app(); - $adminlist = explode(",", str_replace(" ", "", $a->config['admin_email'])); + $admin_email = Config::get('config', 'admin_email'); - //if(local_user() && x($a->user,'email') && x($a->config,'admin_email') && ($a->user['email'] === $a->config['admin_email'])) - /// @TODO This if() + 2 returns can be shrinked into one return - if (local_user() && x($a->user, 'email') && x($a->config, 'admin_email') && in_array($a->user['email'], $adminlist)) { - return true; - } - return false; + $adminlist = explode(',', str_replace(' ', '', $admin_email)); + + return local_user() && $admin_email && in_array(defaults($a->user, 'email', ''), $adminlist); } /**