]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
Merge remote-tracking branch 'upstream/develop' into develop
[friendica.git] / boot.php
index b282f8d48e0b64577860cfcad7da20c4d943a75d..70f7d324d3e383cf2ffd2372305e983a5e25a790 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -670,22 +670,23 @@ class App {
 
                #set_include_path("include/$this->hostname" . PATH_SEPARATOR . get_include_path());
 
-               if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,9) === "pagename=") {
+               if ((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,9) === "pagename=") {
                        $this->query_string = substr($_SERVER['QUERY_STRING'],9);
                        // removing trailing / - maybe a nginx problem
                        if (substr($this->query_string, 0, 1) == "/")
                                $this->query_string = substr($this->query_string, 1);
-               } elseif((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") {
+               } elseif ((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") {
                        $this->query_string = substr($_SERVER['QUERY_STRING'],2);
                        // removing trailing / - maybe a nginx problem
                        if (substr($this->query_string, 0, 1) == "/")
                                $this->query_string = substr($this->query_string, 1);
                }
 
-               if (x($_GET,'pagename'))
+               if (x($_GET,'pagename')) {
                        $this->cmd = trim($_GET['pagename'],'/\\');
-               elseif (x($_GET,'q'))
+               } elseif (x($_GET,'q')) {
                        $this->cmd = trim($_GET['q'],'/\\');
+               }
 
 
                // fix query_string
@@ -694,13 +695,15 @@ class App {
 
                // unix style "homedir"
 
-               if(substr($this->cmd,0,1) === '~')
+               if (substr($this->cmd,0,1) === '~') {
                        $this->cmd = 'profile/' . substr($this->cmd,1);
+               }
 
                // Diaspora style profile url
 
-               if(substr($this->cmd,0,2) === 'u/')
+               if (substr($this->cmd,0,2) === 'u/') {
                        $this->cmd = 'profile/' . substr($this->cmd,2);
+               }
 
 
                /*
@@ -1028,7 +1031,7 @@ class App {
                } else {
                        $r = q("SELECT `contact`.`avatar-date` AS picdate FROM `contact` WHERE `contact`.`thumb` like '%%/%s'",
                                $common_filename);
-                       if(! dbm::is_result($r)){
+                       if (! dbm::is_result($r)) {
                                $this->cached_profile_image[$avatar_image] = $avatar_image;
                        } else {
                                $this->cached_profile_picdate[$common_filename] = "?rev=".urlencode($r[0]['picdate']);
@@ -1537,7 +1540,7 @@ function check_db() {
  * Sets the base url for use in cmdline programs which don't have
  * $_SERVER variables
  */
-function check_url(&$a) {
+function check_url(App &$a) {
 
        $url = get_config('system','url');
 
@@ -1548,9 +1551,9 @@ function check_url(&$a) {
        // We will only change the url to an ip address if there is no existing setting
 
        if(! x($url))
-               $url = set_config('system','url',$a->get_baseurl());
-       if((! link_compare($url,$a->get_baseurl())) && (! preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/",$a->get_hostname)))
-               $url = set_config('system','url',$a->get_baseurl());
+               $url = set_config('system','url',App::get_baseurl());
+       if((! link_compare($url,App::get_baseurl())) && (! preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/",$a->get_hostname)))
+               $url = set_config('system','url',App::get_baseurl());
 
        return;
 }
@@ -1559,7 +1562,7 @@ function check_url(&$a) {
 /**
  * @brief Automatic database updates
  */
-function update_db(&$a) {
+function update_db(App &$a) {
        $build = get_config('system','build');
        if(! x($build))
                $build = set_config('system','build',DB_UPDATE_VERSION);
@@ -1675,7 +1678,7 @@ function run_update_function($x) {
  * @param App $a
  *
         */
-function check_plugins(&$a) {
+function check_plugins(App &$a) {
 
        $r = q("SELECT * FROM `addon` WHERE `installed` = 1");
        if (dbm::is_result($r))
@@ -2410,7 +2413,8 @@ function get_temppath() {
        return("");
 }
 
-function set_template_engine(&$a, $engine = 'internal') {
+/// @deprecated
+function set_template_engine(App &$a, $engine = 'internal') {
 /// @note This function is no longer necessary, but keep it as a wrapper to the class method
 /// to avoid breaking themes again unnecessarily