]> git.mxchange.org Git - friendica.git/blobdiff - include/onepoll.php
Global is an integer, do not set it to an empty string
[friendica.git] / include / onepoll.php
index 2f9bb35d36af17cd0a6cfd9b90a90a5eb7ce7652..5219d9f3bd5f291ec52c8fa8dd7e81814bf12fbb 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use \Friendica\Core\Config;
+
 require_once("boot.php");
 require_once("include/follow.php");
 
@@ -32,8 +34,7 @@ function onepoll_run(&$argv, &$argc){
        require_once('include/socgraph.php');
        require_once('include/queue_fn.php');
 
-       load_config('config');
-       load_config('system');
+       Config::load();
 
        $a->set_baseurl(get_config('system','url'));
 
@@ -143,8 +144,9 @@ function onepoll_run(&$argv, &$argc){
        $r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` INNER JOIN `user` on `contact`.`uid` = `user`.`uid` WHERE `user`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
                intval($importer_uid)
        );
-       if(! dbm::is_result($r))
+       if (! dbm::is_result($r)) {
                return;
+       }
 
        $importer = $r[0];
 
@@ -393,7 +395,7 @@ function onepoll_run(&$argv, &$argc){
                                                        dbesc($datarray['uri'])
                                                );
 
-                                               if(dbm::is_result($r)) {
+                                               if (dbm::is_result($r)) {
                                                        logger("Mail: Seen before ".$msg_uid." for ".$mailconf[0]['user']." UID: ".$importer_uid." URI: ".$datarray['uri'],LOGGER_DEBUG);
 
                                                        // Only delete when mails aren't automatically moved or deleted
@@ -446,7 +448,7 @@ function onepoll_run(&$argv, &$argc){
                                                        $r = q("SELECT `uri` , `parent-uri` FROM `item` USE INDEX (`uid_uri`) WHERE `uri` IN ($qstr) AND `uid` = %d LIMIT 1",
                                                                intval($importer_uid)
                                                        );
-                                                       if(dbm::is_result($r))
+                                                       if (dbm::is_result($r))
                                                                $datarray['parent-uri'] = $r[0]['parent-uri'];  // Set the parent as the top-level item
        //                                                      $datarray['parent-uri'] = $r[0]['uri'];
                                                }
@@ -479,7 +481,7 @@ function onepoll_run(&$argv, &$argc){
                                                                dbesc(protect_sprintf($datarray['title'])),
                                                                intval($importer_uid),
                                                                dbesc(NETWORK_MAIL));
-                                                       if(dbm::is_result($r))
+                                                       if (dbm::is_result($r))
                                                                $datarray['parent-uri'] = $r[0]['parent-uri'];
                                                }