experimental new plugin system
This commit is contained in:
@@ -7,13 +7,6 @@
|
||||
function __autoload($class) {
|
||||
$class_file = str_replace("_", "/", strtolower(basename($class)));
|
||||
|
||||
$file = dirname(__FILE__)."/../plugins/$class_file.php";
|
||||
|
||||
if (file_exists($file)) {
|
||||
require $file;
|
||||
return;
|
||||
}
|
||||
|
||||
$file = dirname(__FILE__)."/../classes/$class_file.php";
|
||||
|
||||
if (file_exists($file)) {
|
||||
@@ -3265,15 +3258,10 @@
|
||||
onclick=\"postOpenInNewTab(event, $id)\"
|
||||
alt='Zoom' title='".__('Open article in new tab')."'>";
|
||||
|
||||
$button_plugins = explode(",", ARTICLE_BUTTON_PLUGINS);
|
||||
global $pluginhost;
|
||||
|
||||
foreach ($button_plugins as $p) {
|
||||
$pclass = "button_" . trim($p);
|
||||
|
||||
if (class_exists($pclass)) {
|
||||
$plugin = new $pclass($link);
|
||||
$rv['content'] .= $plugin->render($id, $line);
|
||||
}
|
||||
foreach ($pluginhost->get_hooks($pluginhost::HOOK_ARTICLE_BUTTON) as $p) {
|
||||
$rv['content'] .= $p->hook_article_button($line);
|
||||
}
|
||||
|
||||
$rv['content'] .= "<img src=\"".theme_image($link, 'images/digest_checkbox.png')."\"
|
||||
@@ -3568,6 +3556,12 @@
|
||||
db_query($link, "SET NAMES " . MYSQL_CHARSET);
|
||||
}
|
||||
}
|
||||
|
||||
global $pluginhost;
|
||||
|
||||
$pluginhost = new PluginHost($link);
|
||||
$pluginhost->load(PLUGINS);
|
||||
|
||||
return true;
|
||||
} else {
|
||||
print "Unable to connect to database:" . db_last_error();
|
||||
|
||||
@@ -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"];
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<?php # This file has been generated at: Fri Sep 7 10:20:51 MSK 2012
|
||||
<?php # This file has been generated at: Sun Dec 23 13:56:09 MSK 2012
|
||||
define('GENERATED_CONFIG_CHECK', 26);
|
||||
$requred_defines = array( 'DB_TYPE', 'DB_HOST', 'DB_USER', 'DB_NAME', 'DB_PASS', 'MYSQL_CHARSET', 'SELF_URL_PATH', 'SINGLE_USER_MODE', 'PHP_EXECUTABLE', 'LOCK_DIRECTORY', 'CACHE_DIR', 'ICONS_DIR', 'ICONS_URL', 'AUTH_MODULES', 'AUTH_AUTO_CREATE', 'AUTH_AUTO_LOGIN', 'DEFAULT_UPDATE_METHOD', 'FORCE_ARTICLE_PURGE', 'PUBSUBHUBBUB_HUB', 'PUBSUBHUBBUB_ENABLED', 'SPHINX_ENABLED', 'SPHINX_INDEX', 'ENABLE_REGISTRATION', 'REG_NOTIFY_ADDRESS', 'REG_MAX_USERS', 'SESSION_COOKIE_LIFETIME', 'SESSION_EXPIRE_TIME', 'SESSION_CHECK_ADDRESS', 'SMTP_FROM_NAME', 'SMTP_FROM_ADDRESS', 'DIGEST_SUBJECT', 'SMTP_HOST', 'SMTP_LOGIN', 'SMTP_PASSWORD', 'CHECK_FOR_NEW_VERSION', 'ENABLE_GZIP_OUTPUT', 'FEEDBACK_URL', 'ARTICLE_BUTTON_PLUGINS', 'CONFIG_VERSION'); ?>
|
||||
$requred_defines = array( 'DB_TYPE', 'DB_HOST', 'DB_USER', 'DB_NAME', 'DB_PASS', 'MYSQL_CHARSET', 'SELF_URL_PATH', 'SINGLE_USER_MODE', 'PHP_EXECUTABLE', 'LOCK_DIRECTORY', 'CACHE_DIR', 'ICONS_DIR', 'ICONS_URL', 'AUTH_MODULES', 'AUTH_AUTO_CREATE', 'AUTH_AUTO_LOGIN', 'DEFAULT_UPDATE_METHOD', 'FORCE_ARTICLE_PURGE', 'PUBSUBHUBBUB_HUB', 'PUBSUBHUBBUB_ENABLED', 'SPHINX_ENABLED', 'SPHINX_INDEX', 'ENABLE_REGISTRATION', 'REG_NOTIFY_ADDRESS', 'REG_MAX_USERS', 'SESSION_COOKIE_LIFETIME', 'SESSION_EXPIRE_TIME', 'SESSION_CHECK_ADDRESS', 'SMTP_FROM_NAME', 'SMTP_FROM_ADDRESS', 'DIGEST_SUBJECT', 'SMTP_HOST', 'SMTP_LOGIN', 'SMTP_PASSWORD', 'CHECK_FOR_NEW_VERSION', 'ENABLE_GZIP_OUTPUT', 'FEEDBACK_URL', 'CONFIG_VERSION'); ?>
|
||||
|
||||
Reference in New Issue
Block a user