]> git.mxchange.org Git - friendica.git/commitdiff
Standards, what else?
authorMichael <heluecht@pirati.ca>
Sun, 19 Mar 2017 08:04:04 +0000 (08:04 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 19 Mar 2017 08:04:04 +0000 (08:04 +0000)
boot.php
include/cron.php
include/poller.php
include/socgraph.php
mod/contacts.php
mod/profiles.php

index 7628e40741806d8544a6e3c653042f49ba7ad00e..6f036d846e90887faa62cc21baf2256bb7224cfc 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -449,9 +449,9 @@ define ('NULL_DATE', '0001-01-01 00:00:00');
 
 
 // Normally this constant is defined - but not if "pcntl" isn't installed
-if (!defined("SIGTERM"))
+if (!defined("SIGTERM")) {
        define("SIGTERM", 15);
-
+}
 /**
  *
  * Reverse the effect of magic_quotes_gpc if it is enabled.
index 7b261aabffa73f5f1e59643f64e9ee1d3402e8a3..93ea167c3851f1a12885f37b03dfdf26435fc541 100644 (file)
@@ -214,11 +214,13 @@ function cron_poll_contacts($argc, $argv) {
 
                        $xml = false;
 
-                       if($manual_id)
+                       if ($manual_id) {
                                $contact['last-update'] = NULL_DATE;
+                       }
 
-                       if(in_array($contact['network'], array(NETWORK_DFRN, NETWORK_ZOT, NETWORK_OSTATUS)))
+                       if (in_array($contact['network'], array(NETWORK_DFRN, NETWORK_ZOT, NETWORK_OSTATUS))) {
                                $contact['priority'] = 2;
+                       }
 
                        if($contact['subhub'] AND in_array($contact['network'], array(NETWORK_DFRN, NETWORK_ZOT, NETWORK_OSTATUS))) {
                                // We should be getting everything via a hub. But just to be sure, let's check once a day.
index 487c86ab3002670516b02297eba0b1d380607bf6..3124c40a7a62cdc2fa4cb43d64d465cbb55bcff4 100644 (file)
@@ -364,11 +364,11 @@ function poller_kill_stale_workers() {
                return;
        }
 
-       foreach($r AS $pid)
-               if (!posix_kill($pid["pid"], 0))
+       foreach ($r AS $pid) {
+               if (!posix_kill($pid["pid"], 0)) {
                        q("UPDATE `workerqueue` SET `executed` = '%s', `pid` = 0 WHERE `pid` = %d",
                                dbesc(NULL_DATE), intval($pid["pid"]));
-               else {
+               else {
                        // Kill long running processes
 
                        // Check if the priority is in a valid range
@@ -400,6 +400,7 @@ function poller_kill_stale_workers() {
                        } else
                                logger("Worker process ".$pid["pid"]." (".implode(" ", $argv).") now runs for ".round($duration)." of ".$max_duration." allowed minutes. That's okay.", LOGGER_DEBUG);
                }
+       }
 }
 
 /**
@@ -558,9 +559,9 @@ function poller_worker_process() {
                                ORDER BY `priority`, `created` LIMIT 1",
                                dbesc(NULL_DATE),
                                intval($highest_priority));
-               if (dbm::is_result($r))
+               if (dbm::is_result($r)) {
                        return $r;
-
+               }
                // Give slower processes some processing time
                $r = q("SELECT * FROM `workerqueue`
                                WHERE `executed` <= '%s' AND `priority` > %d
@@ -570,9 +571,9 @@ function poller_worker_process() {
        }
 
        // If there is no result (or we shouldn't pass lower processes) we check without priority limit
-       if (($highest_priority == 0) OR !dbm::is_result($r))
+       if (($highest_priority == 0) OR !dbm::is_result($r)) {
                $r = q("SELECT * FROM `workerqueue` WHERE `executed` <= '%s' ORDER BY `priority`, `created` LIMIT 1", dbesc(NULL_DATE));
-
+       }
        return $r;
 }
 
index e0d6b156a33ff286eff82078b147a47658a621ec..d9fd6f8be8a04db27482cf19a3180cb7b398f8b4 100644 (file)
@@ -239,12 +239,12 @@ function poco_check($profile_url, $name, $network, $profile_photo, $about, $loca
        );
 
        if (count($x)) {
-               if (($network == "") AND ($x[0]["network"] != NETWORK_STATUSNET))
+               if (($network == "") AND ($x[0]["network"] != NETWORK_STATUSNET)) {
                        $network = $x[0]["network"];
-
-               if ($updated <= NULL_DATE)
+               }
+               if ($updated <= NULL_DATE) {
                        $updated = $x[0]["updated"];
-
+               }
                $created = $x[0]["created"];
                $server_url = $x[0]["server_url"];
                $nick = $x[0]["nick"];
@@ -465,10 +465,10 @@ function poco_last_updated($profile, $force = false) {
        $gcontacts = q("SELECT * FROM `gcontact` WHERE `nurl` = '%s'",
                        dbesc(normalise_link($profile)));
 
-       if ($gcontacts[0]["created"] <= NULL_DATE)
+       if ($gcontacts[0]["created"] <= NULL_DATE) {
                q("UPDATE `gcontact` SET `created` = '%s' WHERE `nurl` = '%s'",
                        dbesc(datetime_convert()), dbesc(normalise_link($profile)));
-
+       }
        if ($gcontacts[0]["server_url"] != "") {
                $server_url = $gcontacts[0]["server_url"];
        }
@@ -664,10 +664,11 @@ function poco_last_updated($profile, $force = false) {
        }
 
        // Maybe there aren't any entries. Then check if it is a valid feed
-       if ($last_updated == "")
-               if ($xpath->query('/atom:feed')->length > 0)
+       if ($last_updated == "") {
+               if ($xpath->query('/atom:feed')->length > 0) {
                        $last_updated = NULL_DATE;
-
+               }
+       }
        q("UPDATE `gcontact` SET `updated` = '%s', `last_contact` = '%s' WHERE `nurl` = '%s'",
                dbesc(dbm::date($last_updated)), dbesc(dbm::date()), dbesc(normalise_link($profile)));
 
@@ -946,10 +947,10 @@ function poco_check_server($server_url, $network = "", $force = false) {
        $servers = q("SELECT * FROM `gserver` WHERE `nurl` = '%s'", dbesc(normalise_link($server_url)));
        if (dbm::is_result($servers)) {
 
-               if ($servers[0]["created"] <= NULL_DATE)
+               if ($servers[0]["created"] <= NULL_DATE) {
                        q("UPDATE `gserver` SET `created` = '%s' WHERE `nurl` = '%s'",
                                dbesc(datetime_convert()), dbesc(normalise_link($server_url)));
-
+               }
                $poco = $servers[0]["poco"];
                $noscrape = $servers[0]["noscrape"];
 
index 0569c8ca4ecaac996e25a4951a37c92f0f7990d1..f2500099c3f44689b37f67b4faf3afb7320ce3dd 100644 (file)
@@ -538,9 +538,9 @@ function contacts_content(App $a) {
                                ? t('Never')
                                : datetime_convert('UTC',date_default_timezone_get(),$contact['last-update'],'D, j M Y, g:i A'));
 
-               if ($contact['last-update'] > NULL_DATE)
+               if ($contact['last-update'] > NULL_DATE) {
                        $last_update .= ' ' . (($contact['last-update'] <= $contact['success_update']) ? t("\x28Update was successful\x29") : t("\x28Update was not successful\x29"));
-
+               }
                $lblsuggest = (($contact['network'] === NETWORK_DFRN) ? t('Suggest friends') : '');
 
                $poll_enabled = in_array($contact['network'], array(NETWORK_DFRN, NETWORK_OSTATUS, NETWORK_FEED, NETWORK_MAIL, NETWORK_MAIL2));
@@ -560,10 +560,10 @@ function contacts_content(App $a) {
 
                $lost_contact = (($contact['archive'] && $contact['term-date'] > NULL_DATE && $contact['term-date'] < datetime_convert('','','now')) ? t('Communications lost with this contact!') : '');
 
-               if ($contact['network'] == NETWORK_FEED)
+               if ($contact['network'] == NETWORK_FEED) {
                        $fetch_further_information = array('fetch_further_information', t('Fetch further information for feeds'), $contact['fetch_further_information'], t('Fetch further information for feeds'),
                                                                        array('0'=>t('Disabled'), '1'=>t('Fetch information'), '2'=>t('Fetch information and keywords')));
-
+               }
                if (in_array($contact['network'], array(NETWORK_FEED, NETWORK_MAIL, NETWORK_MAIL2)))
                        $poll_interval = contact_poll_interval($contact['priority'],(! $poll_enabled));
 
index bf6e828b61d62946d0d9f55ced38282ac1435ba0..4e82ceaacd4632cdd1cb77d9263d5ed47c789c27 100644 (file)
@@ -233,11 +233,11 @@ function profiles_post(App $a) {
 
                $with = ((x($_POST,'with')) ? notags(trim($_POST['with'])) : '');
 
-               if(! strlen($howlong))
+               if(! strlen($howlong)) {
                        $howlong = NULL_DATE;
-               else
+               } else {
                        $howlong = datetime_convert(date_default_timezone_get(),'UTC',$howlong);
-
+               }
                // linkify the relationship target if applicable
 
                $withchanged = false;