|
|
@ -4,9 +4,8 @@
|
|
|
|
define_default('DAEMON_SLEEP_INTERVAL', 120);
|
|
|
|
define_default('DAEMON_SLEEP_INTERVAL', 120);
|
|
|
|
define_default('_MIN_CACHE_FILE_SIZE', 1024);
|
|
|
|
define_default('_MIN_CACHE_FILE_SIZE', 1024);
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: this needs to be removed from global namespace into classes/RSS.php or something
|
|
|
|
class RSSUtils {
|
|
|
|
|
|
|
|
static function calculate_article_hash($article, $pluginhost) {
|
|
|
|
function calculate_article_hash($article, $pluginhost) {
|
|
|
|
|
|
|
|
$tmp = "";
|
|
|
|
$tmp = "";
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($article as $k => $v) {
|
|
|
|
foreach ($article as $k => $v) {
|
|
|
@ -22,7 +21,7 @@
|
|
|
|
return sha1(implode(",", $pluginhost->get_plugin_names()) . $tmp);
|
|
|
|
return sha1(implode(",", $pluginhost->get_plugin_names()) . $tmp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function update_feedbrowser_cache() {
|
|
|
|
static function update_feedbrowser_cache() {
|
|
|
|
|
|
|
|
|
|
|
|
$result = db_query("SELECT feed_url, site_url, title, COUNT(id) AS subscribers
|
|
|
|
$result = db_query("SELECT feed_url, site_url, title, COUNT(id) AS subscribers
|
|
|
|
FROM ttrss_feeds WHERE feed_url NOT IN (SELECT feed_url FROM ttrss_feeds
|
|
|
|
FROM ttrss_feeds WHERE feed_url NOT IN (SELECT feed_url FROM ttrss_feeds
|
|
|
@ -62,7 +61,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function update_daemon_common($limit = DAEMON_FEED_LIMIT, $debug = true) {
|
|
|
|
static function update_daemon_common($limit = DAEMON_FEED_LIMIT, $debug = true) {
|
|
|
|
// Process all other feeds using last_updated and interval parameters
|
|
|
|
// Process all other feeds using last_updated and interval parameters
|
|
|
|
|
|
|
|
|
|
|
|
$schema_version = get_schema_version();
|
|
|
|
$schema_version = get_schema_version();
|
|
|
@ -196,7 +195,7 @@
|
|
|
|
array_push($batch_owners, $tline["owner_uid"]);
|
|
|
|
array_push($batch_owners, $tline["owner_uid"]);
|
|
|
|
|
|
|
|
|
|
|
|
$fstarted = microtime(true);
|
|
|
|
$fstarted = microtime(true);
|
|
|
|
update_rss_feed($tline["id"], true, false);
|
|
|
|
RSSUtils::update_rss_feed($tline["id"], true, false);
|
|
|
|
_debug_suppress(false);
|
|
|
|
_debug_suppress(false);
|
|
|
|
|
|
|
|
|
|
|
|
_debug(sprintf(" %.4f (sec)", microtime(true) - $fstarted));
|
|
|
|
_debug(sprintf(" %.4f (sec)", microtime(true) - $fstarted));
|
|
|
@ -214,7 +213,7 @@
|
|
|
|
foreach ($batch_owners as $owner_uid) {
|
|
|
|
foreach ($batch_owners as $owner_uid) {
|
|
|
|
_debug("Running housekeeping tasks for user $owner_uid...");
|
|
|
|
_debug("Running housekeeping tasks for user $owner_uid...");
|
|
|
|
|
|
|
|
|
|
|
|
housekeeping_user($owner_uid);
|
|
|
|
RSSUtils::housekeeping_user($owner_uid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Send feed digests by email if needed.
|
|
|
|
// Send feed digests by email if needed.
|
|
|
@ -225,7 +224,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// this is used when subscribing
|
|
|
|
// this is used when subscribing
|
|
|
|
function set_basic_feed_info($feed) {
|
|
|
|
static function set_basic_feed_info($feed) {
|
|
|
|
|
|
|
|
|
|
|
|
$feed = db_escape_string($feed);
|
|
|
|
$feed = db_escape_string($feed);
|
|
|
|
|
|
|
|
|
|
|
@ -288,7 +287,7 @@
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
|
|
|
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function update_rss_feed($feed, $no_cache = false) {
|
|
|
|
static function update_rss_feed($feed, $no_cache = false) {
|
|
|
|
|
|
|
|
|
|
|
|
$debug_enabled = defined('DAEMON_EXTENDED_DEBUG') || $_REQUEST['xdebug'];
|
|
|
|
$debug_enabled = defined('DAEMON_EXTENDED_DEBUG') || $_REQUEST['xdebug'];
|
|
|
|
|
|
|
|
|
|
|
@ -310,7 +309,7 @@
|
|
|
|
// this is not optimal currently as it fetches stuff separately TODO: optimize
|
|
|
|
// this is not optimal currently as it fetches stuff separately TODO: optimize
|
|
|
|
if ($title == "[Unknown]") {
|
|
|
|
if ($title == "[Unknown]") {
|
|
|
|
_debug("setting basic feed info for $feed...");
|
|
|
|
_debug("setting basic feed info for $feed...");
|
|
|
|
set_basic_feed_info($feed);
|
|
|
|
RSSUtils::set_basic_feed_info($feed);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$result = db_query("SELECT id,update_interval,auth_login,
|
|
|
|
$result = db_query("SELECT id,update_interval,auth_login,
|
|
|
@ -494,7 +493,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
_debug("checking favicon...", $debug_enabled);
|
|
|
|
_debug("checking favicon...", $debug_enabled);
|
|
|
|
|
|
|
|
|
|
|
|
check_feed_favicon($site_url, $feed);
|
|
|
|
RSSUtils::check_feed_favicon($site_url, $feed);
|
|
|
|
$favicon_modified_new = @filemtime($favicon_file);
|
|
|
|
$favicon_modified_new = @filemtime($favicon_file);
|
|
|
|
|
|
|
|
|
|
|
|
if ($favicon_modified_new > $favicon_modified)
|
|
|
|
if ($favicon_modified_new > $favicon_modified)
|
|
|
@ -601,7 +600,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
$entry_guid = $item->get_id();
|
|
|
|
$entry_guid = $item->get_id();
|
|
|
|
if (!$entry_guid) $entry_guid = $item->get_link();
|
|
|
|
if (!$entry_guid) $entry_guid = $item->get_link();
|
|
|
|
if (!$entry_guid) $entry_guid = make_guid_from_title($item->get_title());
|
|
|
|
if (!$entry_guid) $entry_guid = RSSUtils::make_guid_from_title($item->get_title());
|
|
|
|
if (!$entry_guid) continue;
|
|
|
|
if (!$entry_guid) continue;
|
|
|
|
|
|
|
|
|
|
|
|
$entry_guid = "$owner_uid,$entry_guid";
|
|
|
|
$entry_guid = "$owner_uid,$entry_guid";
|
|
|
@ -713,7 +712,7 @@
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
$entry_plugin_data = "";
|
|
|
|
$entry_plugin_data = "";
|
|
|
|
$entry_current_hash = calculate_article_hash($article, $pluginhost);
|
|
|
|
$entry_current_hash = RSSUtils::calculate_article_hash($article, $pluginhost);
|
|
|
|
|
|
|
|
|
|
|
|
_debug("article hash: $entry_current_hash [stored=$entry_stored_hash]", $debug_enabled);
|
|
|
|
_debug("article hash: $entry_current_hash [stored=$entry_stored_hash]", $debug_enabled);
|
|
|
|
|
|
|
|
|
|
|
@ -771,7 +770,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
$matched_rules = array();
|
|
|
|
$matched_rules = array();
|
|
|
|
|
|
|
|
|
|
|
|
$article_filters = get_article_filters($filters, $article["title"],
|
|
|
|
$article_filters = RSSUtils::get_article_filters($filters, $article["title"],
|
|
|
|
$article["content"], $article["link"], $article["author"],
|
|
|
|
$article["content"], $article["link"], $article["author"],
|
|
|
|
$article["tags"], $matched_rules);
|
|
|
|
$article["tags"], $matched_rules);
|
|
|
|
|
|
|
|
|
|
|
@ -789,7 +788,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$plugin_filter_names = find_article_filters($article_filters, "plugin");
|
|
|
|
$plugin_filter_names = RSSUtils::find_article_filters($article_filters, "plugin");
|
|
|
|
$plugin_filter_actions = $pluginhost->get_filter_actions();
|
|
|
|
$plugin_filter_actions = $pluginhost->get_filter_actions();
|
|
|
|
|
|
|
|
|
|
|
|
if (count($plugin_filter_names) > 0) {
|
|
|
|
if (count($plugin_filter_names) > 0) {
|
|
|
@ -839,7 +838,7 @@
|
|
|
|
_debug("force catchup: $entry_force_catchup");
|
|
|
|
_debug("force catchup: $entry_force_catchup");
|
|
|
|
|
|
|
|
|
|
|
|
if ($cache_images && is_writable(CACHE_DIR . '/images'))
|
|
|
|
if ($cache_images && is_writable(CACHE_DIR . '/images'))
|
|
|
|
cache_media($entry_content, $site_url, $debug_enabled);
|
|
|
|
RSSUtils::cache_media($entry_content, $site_url, $debug_enabled);
|
|
|
|
|
|
|
|
|
|
|
|
$entry_content = db_escape_string($entry_content, false);
|
|
|
|
$entry_content = db_escape_string($entry_content, false);
|
|
|
|
|
|
|
|
|
|
|
@ -911,12 +910,12 @@
|
|
|
|
id = '$ref_id'");
|
|
|
|
id = '$ref_id'");
|
|
|
|
} */
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
|
|
if (find_article_filter($article_filters, "filter")) {
|
|
|
|
if (RSSUtils::find_article_filter($article_filters, "filter")) {
|
|
|
|
//db_query("COMMIT"); // close transaction in progress
|
|
|
|
//db_query("COMMIT"); // close transaction in progress
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$score = calculate_article_score($article_filters) + $entry_score_modifier;
|
|
|
|
$score = RSSUtils::calculate_article_score($article_filters) + $entry_score_modifier;
|
|
|
|
|
|
|
|
|
|
|
|
_debug("initial score: $score [including plugin modifier: $entry_score_modifier]", $debug_enabled);
|
|
|
|
_debug("initial score: $score [including plugin modifier: $entry_score_modifier]", $debug_enabled);
|
|
|
|
|
|
|
|
|
|
|
@ -934,7 +933,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
_debug("user record not found, creating...", $debug_enabled);
|
|
|
|
_debug("user record not found, creating...", $debug_enabled);
|
|
|
|
|
|
|
|
|
|
|
|
if ($score >= -500 && !find_article_filter($article_filters, 'catchup') && !$entry_force_catchup) {
|
|
|
|
if ($score >= -500 && !RSSUtils::find_article_filter($article_filters, 'catchup') && !$entry_force_catchup) {
|
|
|
|
$unread = 'true';
|
|
|
|
$unread = 'true';
|
|
|
|
$last_read_qpart = 'NULL';
|
|
|
|
$last_read_qpart = 'NULL';
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -942,13 +941,13 @@
|
|
|
|
$last_read_qpart = 'NOW()';
|
|
|
|
$last_read_qpart = 'NOW()';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (find_article_filter($article_filters, 'mark') || $score > 1000) {
|
|
|
|
if (RSSUtils::find_article_filter($article_filters, 'mark') || $score > 1000) {
|
|
|
|
$marked = 'true';
|
|
|
|
$marked = 'true';
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$marked = 'false';
|
|
|
|
$marked = 'false';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (find_article_filter($article_filters, 'publish')) {
|
|
|
|
if (RSSUtils::find_article_filter($article_filters, 'publish')) {
|
|
|
|
$published = 'true';
|
|
|
|
$published = 'true';
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$published = 'false';
|
|
|
|
$published = 'false';
|
|
|
@ -1037,7 +1036,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
_debug("assigning labels [filters]...", $debug_enabled);
|
|
|
|
_debug("assigning labels [filters]...", $debug_enabled);
|
|
|
|
|
|
|
|
|
|
|
|
assign_article_to_label_filters($entry_ref_id, $article_filters,
|
|
|
|
RSSUtils::assign_article_to_label_filters($entry_ref_id, $article_filters,
|
|
|
|
$owner_uid, $article_labels);
|
|
|
|
$owner_uid, $article_labels);
|
|
|
|
|
|
|
|
|
|
|
|
_debug("looking for enclosures...", $debug_enabled);
|
|
|
|
_debug("looking for enclosures...", $debug_enabled);
|
|
|
@ -1058,7 +1057,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ($cache_images && is_writable(CACHE_DIR . '/images'))
|
|
|
|
if ($cache_images && is_writable(CACHE_DIR . '/images'))
|
|
|
|
cache_enclosures($enclosures, $site_url, $debug_enabled);
|
|
|
|
RSSUtils::cache_enclosures($enclosures, $site_url, $debug_enabled);
|
|
|
|
|
|
|
|
|
|
|
|
if ($debug_enabled) {
|
|
|
|
if ($debug_enabled) {
|
|
|
|
_debug("article enclosures:", $debug_enabled);
|
|
|
|
_debug("article enclosures:", $debug_enabled);
|
|
|
@ -1205,7 +1204,7 @@
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function cache_enclosures($enclosures, $site_url, $debug) {
|
|
|
|
static function cache_enclosures($enclosures, $site_url, $debug) {
|
|
|
|
foreach ($enclosures as $enc) {
|
|
|
|
foreach ($enclosures as $enc) {
|
|
|
|
|
|
|
|
|
|
|
|
if (preg_match("/(image|audio|video)/", $enc[1])) {
|
|
|
|
if (preg_match("/(image|audio|video)/", $enc[1])) {
|
|
|
@ -1229,7 +1228,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function cache_media($html, $site_url, $debug) {
|
|
|
|
static function cache_media($html, $site_url, $debug) {
|
|
|
|
libxml_use_internal_errors(true);
|
|
|
|
libxml_use_internal_errors(true);
|
|
|
|
|
|
|
|
|
|
|
|
$charset_hack = '<head>
|
|
|
|
$charset_hack = '<head>
|
|
|
@ -1263,7 +1262,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function expire_error_log($debug) {
|
|
|
|
static function expire_error_log($debug) {
|
|
|
|
if ($debug) _debug("Removing old error log entries...");
|
|
|
|
if ($debug) _debug("Removing old error log entries...");
|
|
|
|
|
|
|
|
|
|
|
|
if (DB_TYPE == "pgsql") {
|
|
|
|
if (DB_TYPE == "pgsql") {
|
|
|
@ -1276,7 +1275,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function expire_lock_files($debug) {
|
|
|
|
static function expire_lock_files($debug) {
|
|
|
|
//if ($debug) _debug("Removing old lock files...");
|
|
|
|
//if ($debug) _debug("Removing old lock files...");
|
|
|
|
|
|
|
|
|
|
|
|
$num_deleted = 0;
|
|
|
|
$num_deleted = 0;
|
|
|
@ -1297,7 +1296,7 @@
|
|
|
|
if ($debug) _debug("Removed $num_deleted old lock files.");
|
|
|
|
if ($debug) _debug("Removed $num_deleted old lock files.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function expire_cached_files($debug) {
|
|
|
|
static function expire_cached_files($debug) {
|
|
|
|
foreach (array("simplepie", "images", "export", "upload") as $dir) {
|
|
|
|
foreach (array("simplepie", "images", "export", "upload") as $dir) {
|
|
|
|
$cache_dir = CACHE_DIR . "/$dir";
|
|
|
|
$cache_dir = CACHE_DIR . "/$dir";
|
|
|
|
|
|
|
|
|
|
|
@ -1330,7 +1329,7 @@
|
|
|
|
* @param string query
|
|
|
|
* @param string query
|
|
|
|
* @return array params
|
|
|
|
* @return array params
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function convertUrlQuery($query) {
|
|
|
|
static function convertUrlQuery($query) {
|
|
|
|
$queryParts = explode('&', $query);
|
|
|
|
$queryParts = explode('&', $query);
|
|
|
|
|
|
|
|
|
|
|
|
$params = array();
|
|
|
|
$params = array();
|
|
|
@ -1343,7 +1342,7 @@
|
|
|
|
return $params;
|
|
|
|
return $params;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function get_article_filters($filters, $title, $content, $link, $author, $tags, &$matched_rules = false) {
|
|
|
|
static function get_article_filters($filters, $title, $content, $link, $author, $tags, &$matched_rules = false) {
|
|
|
|
$matches = array();
|
|
|
|
$matches = array();
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($filters as $filter) {
|
|
|
|
foreach ($filters as $filter) {
|
|
|
@ -1423,7 +1422,7 @@
|
|
|
|
return $matches;
|
|
|
|
return $matches;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function find_article_filter($filters, $filter_name) {
|
|
|
|
static function find_article_filter($filters, $filter_name) {
|
|
|
|
foreach ($filters as $f) {
|
|
|
|
foreach ($filters as $f) {
|
|
|
|
if ($f["type"] == $filter_name) {
|
|
|
|
if ($f["type"] == $filter_name) {
|
|
|
|
return $f;
|
|
|
|
return $f;
|
|
|
@ -1432,7 +1431,7 @@
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function find_article_filters($filters, $filter_name) {
|
|
|
|
static function find_article_filters($filters, $filter_name) {
|
|
|
|
$results = array();
|
|
|
|
$results = array();
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($filters as $f) {
|
|
|
|
foreach ($filters as $f) {
|
|
|
@ -1443,7 +1442,7 @@
|
|
|
|
return $results;
|
|
|
|
return $results;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function calculate_article_score($filters) {
|
|
|
|
static function calculate_article_score($filters) {
|
|
|
|
$score = 0;
|
|
|
|
$score = 0;
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($filters as $f) {
|
|
|
|
foreach ($filters as $f) {
|
|
|
@ -1454,7 +1453,7 @@
|
|
|
|
return $score;
|
|
|
|
return $score;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function labels_contains_caption($labels, $caption) {
|
|
|
|
static function labels_contains_caption($labels, $caption) {
|
|
|
|
foreach ($labels as $label) {
|
|
|
|
foreach ($labels as $label) {
|
|
|
|
if ($label[1] == $caption) {
|
|
|
|
if ($label[1] == $caption) {
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
@ -1464,22 +1463,22 @@
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function assign_article_to_label_filters($id, $filters, $owner_uid, $article_labels) {
|
|
|
|
static function assign_article_to_label_filters($id, $filters, $owner_uid, $article_labels) {
|
|
|
|
foreach ($filters as $f) {
|
|
|
|
foreach ($filters as $f) {
|
|
|
|
if ($f["type"] == "label") {
|
|
|
|
if ($f["type"] == "label") {
|
|
|
|
if (!labels_contains_caption($article_labels, $f["param"])) {
|
|
|
|
if (!RSSUtils::labels_contains_caption($article_labels, $f["param"])) {
|
|
|
|
Labels::add_article($id, $f["param"], $owner_uid);
|
|
|
|
Labels::add_article($id, $f["param"], $owner_uid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function make_guid_from_title($title) {
|
|
|
|
static function make_guid_from_title($title) {
|
|
|
|
return preg_replace("/[ \"\',.:;]/", "-",
|
|
|
|
return preg_replace("/[ \"\',.:;]/", "-",
|
|
|
|
mb_strtolower(strip_tags($title), 'utf-8'));
|
|
|
|
mb_strtolower(strip_tags($title), 'utf-8'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function cleanup_counters_cache($debug) {
|
|
|
|
static function cleanup_counters_cache($debug) {
|
|
|
|
$result = db_query("DELETE FROM ttrss_counters_cache
|
|
|
|
$result = db_query("DELETE FROM ttrss_counters_cache
|
|
|
|
WHERE feed_id > 0 AND
|
|
|
|
WHERE feed_id > 0 AND
|
|
|
|
(SELECT COUNT(id) FROM ttrss_feeds WHERE
|
|
|
|
(SELECT COUNT(id) FROM ttrss_feeds WHERE
|
|
|
@ -1497,7 +1496,7 @@
|
|
|
|
if ($debug) _debug("Removed $frows (feeds) $crows (cats) orphaned counter cache entries.");
|
|
|
|
if ($debug) _debug("Removed $frows (feeds) $crows (cats) orphaned counter cache entries.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function housekeeping_user($owner_uid) {
|
|
|
|
static function housekeeping_user($owner_uid) {
|
|
|
|
$tmph = new PluginHost();
|
|
|
|
$tmph = new PluginHost();
|
|
|
|
|
|
|
|
|
|
|
|
load_user_plugins($owner_uid, $tmph);
|
|
|
|
load_user_plugins($owner_uid, $tmph);
|
|
|
@ -1505,16 +1504,16 @@
|
|
|
|
$tmph->run_hooks(PluginHost::HOOK_HOUSE_KEEPING, "hook_house_keeping", "");
|
|
|
|
$tmph->run_hooks(PluginHost::HOOK_HOUSE_KEEPING, "hook_house_keeping", "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function housekeeping_common($debug) {
|
|
|
|
static function housekeeping_common($debug) {
|
|
|
|
expire_cached_files($debug);
|
|
|
|
RSSUtils::expire_cached_files($debug);
|
|
|
|
expire_lock_files($debug);
|
|
|
|
RSSUtils::expire_lock_files($debug);
|
|
|
|
expire_error_log($debug);
|
|
|
|
RSSUtils::expire_error_log($debug);
|
|
|
|
|
|
|
|
|
|
|
|
$count = update_feedbrowser_cache();
|
|
|
|
$count = RSSUtils::update_feedbrowser_cache();
|
|
|
|
_debug("Feedbrowser updated, $count feeds processed.");
|
|
|
|
_debug("Feedbrowser updated, $count feeds processed.");
|
|
|
|
|
|
|
|
|
|
|
|
Article::purge_orphans( true);
|
|
|
|
Article::purge_orphans( true);
|
|
|
|
cleanup_counters_cache($debug);
|
|
|
|
RSSUtils::cleanup_counters_cache($debug);
|
|
|
|
|
|
|
|
|
|
|
|
//$rc = cleanup_tags( 14, 50000);
|
|
|
|
//$rc = cleanup_tags( 14, 50000);
|
|
|
|
//_debug("Cleaned $rc cached tags.");
|
|
|
|
//_debug("Cleaned $rc cached tags.");
|
|
|
@ -1522,7 +1521,7 @@
|
|
|
|
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_HOUSE_KEEPING, "hook_house_keeping", "");
|
|
|
|
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_HOUSE_KEEPING, "hook_house_keeping", "");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function check_feed_favicon($site_url, $feed) {
|
|
|
|
static function check_feed_favicon($site_url, $feed) {
|
|
|
|
# print "FAVICON [$site_url]: $favicon_url\n";
|
|
|
|
# print "FAVICON [$site_url]: $favicon_url\n";
|
|
|
|
|
|
|
|
|
|
|
|
$icon_file = ICONS_DIR . "/$feed.ico";
|
|
|
|
$icon_file = ICONS_DIR . "/$feed.ico";
|
|
|
@ -1572,3 +1571,7 @@
|
|
|
|
return $icon_file;
|
|
|
|
return $icon_file;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|