]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
Only distribute items to active contacts
[friendica.git] / boot.php
index 5b497632ebea9136af059c0450a081a2b6c9c8e9..dec4eca32b5e83bb3650d5c6696c597364fb8c42 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -767,7 +767,7 @@ class App {
 
        }
 
-       function get_basepath() {
+       public static function get_basepath() {
 
                $basepath = get_config("system", "basepath");
 
@@ -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']);
@@ -1191,7 +1191,7 @@ class App {
                q("START TRANSACTION");
 
                $r = q("SELECT `pid` FROM `process` WHERE `pid` = %d", intval(getmypid()));
-               if(!dbm::is_result($r)) {
+               if (!dbm::is_result($r)) {
                        q("INSERT INTO `process` (`pid`,`command`,`created`) VALUES (%d, '%s', '%s')",
                                intval(getmypid()),
                                dbesc($command),
@@ -1207,7 +1207,7 @@ class App {
                q("START TRANSACTION");
 
                $r = q("SELECT `pid` FROM `process`");
-               if(dbm::is_result($r)) {
+               if (dbm::is_result($r)) {
                        foreach ($r AS $process) {
                                if (!posix_kill($process["pid"], 0)) {
                                        q("DELETE FROM `process` WHERE `pid` = %d", intval($process["pid"]));
@@ -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();
 }
 
 /**
@@ -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;
 }
@@ -1677,7 +1678,7 @@ function run_update_function($x) {
 function check_plugins(&$a) {
 
        $r = q("SELECT * FROM `addon` WHERE `installed` = 1");
-       if(dbm::is_result($r))
+       if (dbm::is_result($r))
                $installed = $r;
        else
                $installed = array();
@@ -2021,7 +2022,7 @@ function current_theme(){
                $r = q("select theme from user where uid = %d limit 1",
                        intval($a->profile_uid)
                );
-               if(dbm::is_result($r))
+               if (dbm::is_result($r))
                        $page_theme = $r[0]['theme'];
        }
 
@@ -2134,7 +2135,7 @@ function feed_birthday($uid,$tz) {
                        intval($uid)
        );
 
-       if(dbm::is_result($p)) {
+       if (dbm::is_result($p)) {
                $tmp_dob = substr($p[0]['dob'],5);
                if(intval($tmp_dob)) {
                        $y = datetime_convert($tz,$tz,'now','Y');