]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
Merge branch 'develop' into rewrites/dbm_is_result
[friendica.git] / boot.php
index fda6b7d7bb78a2722a55019b3540e4e23a7d402f..ccff45f7343295d6b4c29648febce22a55e3735c 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1028,7 +1028,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']);
@@ -1478,10 +1478,11 @@ function clean_urls() {
 }
 
 function z_path() {
-       $a = get_app();
-       $base = $a->get_baseurl();
+       $base = App::get_baseurl();
+
        if(! clean_urls())
                $base .= '/?q=';
+
        return $base;
 }
 
@@ -1491,10 +1492,10 @@ function z_path() {
  * @see App::get_baseurl()
  *
  * @return string
+ * @TODO Maybe super-flous and deprecated? Seems to only wrap App::get_baseurl()
  */
 function z_root() {
-       $a = get_app();
-       return $a->get_baseurl();
+       return App::get_baseurl();
 }
 
 /**
@@ -1536,7 +1537,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');
 
@@ -1547,9 +1548,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;
 }
@@ -1558,7 +1559,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);
@@ -1674,7 +1675,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))
@@ -2409,7 +2410,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