summaryrefslogtreecommitdiff
path: root/modules/aggregator
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-24 00:14:23 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-24 00:14:23 +0000
commit2c552193154dd49a335b883019e216430a097790 (patch)
tree0105ac8012cddcf8f4f2b63a27f66d0457dfd5cd /modules/aggregator
parent00280ca9885a668dd28831cacd536d11f98df36f (diff)
downloadbrdo-2c552193154dd49a335b883019e216430a097790.tar.gz
brdo-2c552193154dd49a335b883019e216430a097790.tar.bz2
#497118 by chx, catch, pwolanin, JoshuaRogers, and Jacob Singh: Remove the function registry. While the hope was that this would result in improved performance for low-end hosts, it comes at the expense of critical development experience problems and less benefit than something like APC. Class registry remains intact to facilitate autoloading.
Diffstat (limited to 'modules/aggregator')
-rw-r--r--modules/aggregator/aggregator.admin.inc1
-rw-r--r--modules/aggregator/aggregator.fetcher.inc1
-rw-r--r--modules/aggregator/aggregator.module49
3 files changed, 41 insertions, 10 deletions
diff --git a/modules/aggregator/aggregator.admin.inc b/modules/aggregator/aggregator.admin.inc
index b6361aba6..c425c6d3c 100644
--- a/modules/aggregator/aggregator.admin.inc
+++ b/modules/aggregator/aggregator.admin.inc
@@ -391,7 +391,6 @@ function aggregator_admin_refresh_feed($feed) {
* @ingroup forms
*/
function aggregator_admin_form($form_state) {
-
// Make sure configuration is sane.
aggregator_sanitize_configuration();
diff --git a/modules/aggregator/aggregator.fetcher.inc b/modules/aggregator/aggregator.fetcher.inc
index fcad26578..8798796b7 100644
--- a/modules/aggregator/aggregator.fetcher.inc
+++ b/modules/aggregator/aggregator.fetcher.inc
@@ -34,7 +34,6 @@ function aggregator_aggregator_fetch($feed) {
// Request feed.
$result = drupal_http_request($feed->url, array('headers' => $headers));
-
// Process HTTP response code.
switch ($result->code) {
case 304:
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index a95c64bed..89664ceec 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -91,6 +91,7 @@ function aggregator_menu() {
'description' => "Configure which content your site aggregates from other sites, how often it polls them, and how they're categorized.",
'page callback' => 'aggregator_admin_overview',
'access arguments' => array('administer news feeds'),
+ 'file' => 'aggregator.admin.inc',
);
$items['admin/settings/aggregator/add/feed'] = array(
'title' => 'Add feed',
@@ -99,6 +100,7 @@ function aggregator_menu() {
'access arguments' => array('administer news feeds'),
'type' => MENU_LOCAL_ACTION,
'parent' => 'admin/settings/aggregator',
+ 'file' => 'aggregator.admin.inc',
);
$items['admin/settings/aggregator/add/category'] = array(
'title' => 'Add category',
@@ -107,6 +109,7 @@ function aggregator_menu() {
'access arguments' => array('administer news feeds'),
'type' => MENU_LOCAL_ACTION,
'parent' => 'admin/settings/aggregator',
+ 'file' => 'aggregator.admin.inc',
);
$items['admin/settings/aggregator/add/opml'] = array(
'title' => 'Import OPML',
@@ -115,6 +118,7 @@ function aggregator_menu() {
'access arguments' => array('administer news feeds'),
'type' => MENU_LOCAL_ACTION,
'parent' => 'admin/settings/aggregator',
+ 'file' => 'aggregator.admin.inc',
);
$items['admin/settings/aggregator/remove/%aggregator_feed'] = array(
'title' => 'Remove items',
@@ -122,6 +126,7 @@ function aggregator_menu() {
'page arguments' => array('aggregator_admin_remove_feed', 4),
'access arguments' => array('administer news feeds'),
'type' => MENU_CALLBACK,
+ 'file' => 'aggregator.admin.inc',
);
$items['admin/settings/aggregator/update/%aggregator_feed'] = array(
'title' => 'Update items',
@@ -129,6 +134,7 @@ function aggregator_menu() {
'page arguments' => array(4),
'access arguments' => array('administer news feeds'),
'type' => MENU_CALLBACK,
+ 'file' => 'aggregator.admin.inc',
);
$items['admin/settings/aggregator/list'] = array(
'title' => 'List',
@@ -141,34 +147,40 @@ function aggregator_menu() {
'page callback' => 'drupal_get_form',
'page arguments' => array('aggregator_admin_form'),
'access arguments' => array('administer news feeds'),
+ 'file' => 'aggregator.admin.inc',
);
$items['aggregator'] = array(
'title' => 'Feed aggregator',
'page callback' => 'aggregator_page_last',
'access arguments' => array('access news feeds'),
'weight' => 5,
+ 'file' => 'aggregator.pages.inc',
);
$items['aggregator/sources'] = array(
'title' => 'Sources',
'page callback' => 'aggregator_page_sources',
'access arguments' => array('access news feeds'),
+ 'file' => 'aggregator.pages.inc',
);
$items['aggregator/categories'] = array(
'title' => 'Categories',
'page callback' => 'aggregator_page_categories',
'access callback' => '_aggregator_has_categories',
+ 'file' => 'aggregator.pages.inc',
);
$items['aggregator/rss'] = array(
'title' => 'RSS feed',
'page callback' => 'aggregator_page_rss',
'access arguments' => array('access news feeds'),
'type' => MENU_CALLBACK,
+ 'file' => 'aggregator.pages.inc',
);
$items['aggregator/opml'] = array(
'title' => 'OPML feed',
'page callback' => 'aggregator_page_opml',
'access arguments' => array('access news feeds'),
'type' => MENU_CALLBACK,
+ 'file' => 'aggregator.pages.inc',
);
$items['aggregator/categories/%aggregator_category'] = array(
'title callback' => '_aggregator_category_title',
@@ -177,6 +189,7 @@ function aggregator_menu() {
'page arguments' => array(2),
'access callback' => 'user_access',
'access arguments' => array('access news feeds'),
+ 'file' => 'aggregator.pages.inc',
);
$items['aggregator/categories/%aggregator_category/view'] = array(
'title' => 'View',
@@ -189,6 +202,7 @@ function aggregator_menu() {
'page arguments' => array('aggregator_page_category', 2),
'access arguments' => array('administer news feeds'),
'type' => MENU_LOCAL_TASK,
+ 'file' => 'aggregator.pages.inc',
);
$items['aggregator/categories/%aggregator_category/configure'] = array(
'title' => 'Configure',
@@ -197,12 +211,14 @@ function aggregator_menu() {
'access arguments' => array('administer news feeds'),
'type' => MENU_LOCAL_TASK,
'weight' => 1,
+ 'file' => 'aggregator.admin.inc',
);
$items['aggregator/sources/%aggregator_feed'] = array(
'page callback' => 'aggregator_page_source',
'page arguments' => array(2),
'access arguments' => array('access news feeds'),
'type' => MENU_CALLBACK,
+ 'file' => 'aggregator.pages.inc',
);
$items['aggregator/sources/%aggregator_feed/view'] = array(
'title' => 'View',
@@ -215,6 +231,7 @@ function aggregator_menu() {
'page arguments' => array('aggregator_page_source', 2),
'access arguments' => array('administer news feeds'),
'type' => MENU_LOCAL_TASK,
+ 'file' => 'aggregator.pages.inc',
);
$items['aggregator/sources/%aggregator_feed/configure'] = array(
'title' => 'Configure',
@@ -223,6 +240,7 @@ function aggregator_menu() {
'access arguments' => array('administer news feeds'),
'type' => MENU_LOCAL_TASK,
'weight' => 1,
+ 'file' => 'aggregator.admin.inc',
);
$items['admin/settings/aggregator/edit/feed/%aggregator_feed'] = array(
'title' => 'Edit feed',
@@ -230,6 +248,7 @@ function aggregator_menu() {
'page arguments' => array('aggregator_form_feed', 5),
'access arguments' => array('administer news feeds'),
'type' => MENU_CALLBACK,
+ 'file' => 'aggregator.admin.inc',
);
$items['admin/settings/aggregator/edit/category/%aggregator_category'] = array(
'title' => 'Edit category',
@@ -237,6 +256,7 @@ function aggregator_menu() {
'page arguments' => array('aggregator_form_category', 5),
'access arguments' => array('administer news feeds'),
'type' => MENU_CALLBACK,
+ 'file' => 'aggregator.admin.inc',
);
return $items;
@@ -514,6 +534,7 @@ function aggregator_save_feed($edit) {
* An object describing the feed to be cleared.
*/
function aggregator_remove($feed) {
+ _aggregator_get_variables();
// Call hook_aggregator_remove() on all modules.
module_invoke_all('aggregator_remove', $feed);
// Reset feed.
@@ -530,6 +551,23 @@ function aggregator_remove($feed) {
->execute();
}
+function _aggregator_get_variables() {
+ // Fetch the feed.
+ $fetcher = variable_get('aggregator_fetcher', 'aggregator');
+ if ($fetcher == 'aggregator') {
+ include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'aggregator') . '/aggregator.fetcher.inc';
+ }
+ $parser = variable_get('aggregator_parser', 'aggregator');
+ if ($parser == 'aggregator') {
+ include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'aggregator') . '/aggregator.parser.inc';
+ }
+ $processors = variable_get('aggregator_processors', array('aggregator'));
+ if (in_array('aggregator', $processors)) {
+ include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'aggregator') . '/aggregator.processor.inc';
+ }
+ return array($fetcher, $parser, $processors);
+}
+
/**
* Checks a news feed for new items.
*
@@ -537,25 +575,22 @@ function aggregator_remove($feed) {
* An object describing the feed to be refreshed.
*/
function aggregator_refresh($feed) {
- // Fetch the feed.
- $fetcher = variable_get('aggregator_fetcher', 'aggregator');
+ list($fetcher, $parser, $processors) = _aggregator_get_variables();
module_invoke($fetcher, 'aggregator_fetch', $feed);
if ($feed->source_string !== FALSE) {
// Parse the feed.
- $parser = variable_get('aggregator_parser', 'aggregator');
module_invoke($parser, 'aggregator_parse', $feed);
// If there are items on the feed, let all enabled processors do their work on it.
if (@count($feed->items)) {
- $processors = variable_get('aggregator_processors', array('aggregator'));
foreach ($processors as $processor) {
module_invoke($processor, 'aggregator_process', $feed);
}
}
}
// Expire old feed items.
- if (drupal_function_exists('aggregator_expire')) {
+ if (function_exists('aggregator_expire')) {
aggregator_expire($feed);
}
}
@@ -635,15 +670,13 @@ function aggregator_filter_xss($value) {
*/
function aggregator_sanitize_configuration() {
$reset = FALSE;
- $fetcher = variable_get('aggregator_fetcher', 'aggregator');
+ list($fetcher, $parser, $processors) = _aggregator_get_variables();
if (!module_exists($fetcher)) {
$reset = TRUE;
}
- $parser = variable_get('aggregator_parser', 'aggregator');
if (!module_exists($parser)) {
$reset = TRUE;
}
- $processors = variable_get('aggregator_processors', array('aggregator'));
foreach ($processors as $processor) {
if (!module_exists($processor)) {
$reset = TRUE;