1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-16 07:55:57 +00:00

experimental new plugin system

This commit is contained in:
Andrew Dolgov
2012-12-23 14:52:18 +04:00
parent 83e6e313be
commit 19c7350770
29 changed files with 204 additions and 164 deletions

View File

@@ -399,23 +399,6 @@
_debug("update_rss_feed: " . count($filters) . " filters loaded.");
}
$filter_plugins = array();
if (defined('_ARTICLE_FILTER_PLUGINS')) {
foreach (explode(",", _ARTICLE_FILTER_PLUGINS) as $p) {
$pclass = "filter_" . trim($p);
if (class_exists($pclass)) {
$plugin = new $pclass($link);
array_push($filter_plugins, $plugin);
}
}
}
if ($debug_enabled) {
_debug("update_rss_feed: " . count($filter_plugins) . " filter plugins loaded.");
}
if ($use_simplepie) {
$iterator = $rss->get_items();
} else {
@@ -782,7 +765,9 @@
}
// TODO: less memory-hungry implementation
if (count($filter_plugins) > 0) {
global $pluginhost;
foreach ($pluginhost->get_hooks($pluginhost::HOOK_ARTICLE_FILTER) as $p) {
if ($debug_enabled) {
_debug("update_rss_feed: applying plugin filters...");
}
@@ -795,7 +780,7 @@
"author" => $entry_author);
foreach ($filter_plugins as $plugin) {
$article = $plugin->filter_article($article);
$article = $plugin->hook_article_filter($article);
}
$entry_title = $article["title"];