]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/System.php
Merge pull request #8222 from annando/ap-gnusocial
[friendica.git] / src / Core / System.php
index f367d28587a9452b265f41dc9a080e146de7e2a7..b0cfe28bee0cdf5b8746e4f5d369280925dc00a2 100644 (file)
@@ -4,50 +4,25 @@
  */
 namespace Friendica\Core;
 
-use Friendica\App\BaseURL;
-use Friendica\BaseObject;
+use Friendica\DI;
 use Friendica\Network\HTTPException\InternalServerErrorException;
 use Friendica\Util\XML;
 
 /**
  * @file include/Core/System.php
  *
- * @brief Contains the class with system relevant stuff
+ * Contains the class with system relevant stuff
  */
 
 
 /**
- * @brief System methods
+ * System methods
  */
-class System extends BaseObject
+class System
 {
        /**
-        * @brief Retrieves the Friendica instance base URL
+        * Returns a string with a callstack. Can be used for logging.
         *
-        * @param bool $ssl Whether to append http or https under BaseURL::SSL_POLICY_SELFSIGN
-        * @return string Friendica server base URL
-        * @throws InternalServerErrorException
-        */
-       public static function baseUrl($ssl = false)
-       {
-               return self::getClass(BaseURL::class)->get($ssl);
-       }
-
-       /**
-        * @brief Removes the baseurl from an url. This avoids some mixed content problems.
-        *
-        * @param string $orig_url The url to be cleaned
-        *
-        * @return string The cleaned url
-        * @throws \Exception
-        */
-       public static function removedBaseUrl($orig_url)
-       {
-               return self::getApp()->removeBaseURL($orig_url);
-       }
-
-       /**
-        * @brief Returns a string with a callstack. Can be used for logging.
         * @param integer $depth optional, default 4
         * @return string
         */
@@ -119,7 +94,7 @@ class System extends BaseObject
        }
 
        /**
-        * @brief Send HTTP status header and exit.
+        * Send HTTP status header and exit.
         *
         * @param integer $val     HTTP status result value
         * @param string  $message Error message. Optional.
@@ -143,7 +118,7 @@ class System extends BaseObject
        }
 
        /**
-        * @brief Encodes content to json.
+        * Encodes content to json.
         *
         * This function encodes an array to json format
         * and adds an application/json HTTP header to the output.
@@ -184,7 +159,7 @@ class System extends BaseObject
                if (is_bool($prefix) && !$prefix) {
                        $prefix = '';
                } elseif (empty($prefix)) {
-                       $prefix = hash('crc32', self::getApp()->getHostName());
+                       $prefix = hash('crc32', DI::baseUrl()->getHostname());
                }
 
                while (strlen($prefix) < ($size - 13)) {
@@ -253,7 +228,7 @@ class System extends BaseObject
        }
 
        /**
-        * @brief Returns the system user that is executing the script
+        * Returns the system user that is executing the script
         *
         * This mostly returns something like "www-data".
         *
@@ -270,7 +245,7 @@ class System extends BaseObject
        }
 
        /**
-        * @brief Checks if a given directory is usable for the system
+        * Checks if a given directory is usable for the system
         *
         * @param      $directory
         * @param bool $check_writable
@@ -309,14 +284,12 @@ class System extends BaseObject
 
        /// @todo Move the following functions from boot.php
        /*
-       function killme()
        function local_user()
        function public_contact()
        function remote_user()
        function notice($s)
        function info($s)
        function is_site_admin()
-       function get_server()
        function get_temppath()
        function get_cachefile($file, $writemode = true)
        function get_itemcachepath()