From d32834581560b959553f4f70e9d467732e0f2c36 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 17 Dec 2017 11:35:06 -0500 Subject: [PATCH] Simplify System class - Add extension to BaseObject to access App object --- src/Core/System.php | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) 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); } /** -- 2.39.5