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