From: Hypolite Petovan Date: Sun, 17 Dec 2017 16:35:06 +0000 (-0500) Subject: Simplify System class X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d32834581560b959553f4f70e9d467732e0f2c36;p=friendica.git Simplify System class - Add extension to BaseObject to access App object --- diff --git a/src/Core/System.php b/src/Core/System.php index 1c4d863306..4ec5b2ad35 100644 --- a/src/Core/System.php +++ b/src/Core/System.php @@ -4,7 +4,7 @@ */ namespace Friendica\Core; -use Friendica\App; +use Friendica\BaseObject; /** * @file include/Core/System.php @@ -16,23 +16,8 @@ use Friendica\App; /** * @brief System methods */ -class System +class System extends BaseObject { - private static $a; - - /** - * @brief Initializes the static class variable - * @return void - */ - private static function init() - { - global $a; - - if (!is_object(self::$a)) { - self::$a = $a; - } - } - /** * @brief Retrieves the Friendica instance base URL * @@ -41,8 +26,7 @@ class System */ public static function baseUrl($ssl = false) { - self::init(); - return self::$a->get_baseurl($ssl); + return self::getApp()->get_baseurl($ssl); } /** @@ -54,8 +38,7 @@ class System */ public static function removedBaseUrl($orig_url) { - self::init(); - return self::$a->remove_baseurl($orig_url); + return self::getApp()->remove_baseurl($orig_url); } /**