]> git.wh0rd.org - tt-rss.git/blobdiff - classes/article.php
debug logging system rework:
[tt-rss.git] / classes / article.php
index 075da19409d986fb5f58bd0d7de21c216eae7387..e769a3e9672edde43e38203b949ac9c794b292de 100755 (executable)
@@ -936,24 +936,24 @@ class Article extends Handler_Protected {
                return $rv;
        }
 
-       static function purge_orphans($do_output = false) {
+       static function purge_orphans() {
 
-               // purge orphaned posts in main content table
+        // purge orphaned posts in main content table
 
-               if (DB_TYPE == "mysql")
-                       $limit_qpart = "LIMIT 5000";
-               else
-                       $limit_qpart = "";
+        if (DB_TYPE == "mysql")
+            $limit_qpart = "LIMIT 5000";
+        else
+            $limit_qpart = "";
 
-               $pdo = Db::pdo();
-               $res = $pdo->query("DELETE FROM ttrss_entries WHERE
+        $pdo = Db::pdo();
+        $res = $pdo->query("DELETE FROM ttrss_entries WHERE
                        NOT EXISTS (SELECT ref_id FROM ttrss_user_entries WHERE ref_id = id) $limit_qpart");
 
-               if ($do_output) {
-                       $rows = $res->rowCount();
-                       _debug("Purged $rows orphaned posts.");
-               }
-       }
+        if (Debug::enabled()) {
+            $rows = $res->rowCount();
+            Debug::log("Purged $rows orphaned posts.");
+        }
+    }
 
        static function catchupArticlesById($ids, $cmode, $owner_uid = false) {