]> git.mxchange.org Git - friendica.git/blob - src/Core/System.php
App::get_baseurl is now replaced with System::baseUrl
[friendica.git] / src / Core / System.php
1 <?php
2 namespace Friendica\Core;
3
4 use Friendica\App;
5
6 /**
7  * @file include/Core/System.php
8  *
9  * @brief Contains the class with system relevant stuff
10  */
11
12
13 /**
14  * @brief System methods
15  */
16 class System {
17
18         private static $a;
19
20         /**
21          * @brief Initializes the static class variable
22          */
23         private static function init() {
24                 global $a;
25
26                 if (!is_object(self::$a)) {
27                         self::$a = $a;
28                 }
29         }
30
31         /**
32          * @brief Retrieves the Friendica instance base URL
33          *
34          * @param bool $ssl Whether to append http or https under SSL_POLICY_SELFSIGN
35          * @return string Friendica server base URL
36          */
37         public static function baseUrl($ssl = false) {
38                 self::init();
39                 return self::$a->get_baseurl($ssl);
40         }
41
42         /**
43          * @brief Removes the baseurl from an url. This avoids some mixed content problems.
44          *
45          * @param string $orig_url
46          *
47          * @return string The cleaned url
48          */
49         function removedBaseUrl($orig_url) {
50                 self::init();
51                 return self::$a->remove_baseurl($orig_url);
52         }
53
54         /// @todo Move the following functions from boot.php
55         /*
56         function get_guid($size = 16, $prefix = "")
57         function killme()
58         function goaway($s)
59         function local_user()
60         function public_contact()
61         function remote_user()
62         function notice($s)
63         function info($s)
64         function is_site_admin()
65         function random_digits($digits)
66         function get_server()
67         function get_temppath()
68         function get_cachefile($file, $writemode = true)
69         function get_itemcachepath()
70         function get_spoolpath()
71         function current_load()
72         */
73 }