aboutsummaryrefslogtreecommitdiff
path: root/mod/garbagecollector
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-31 12:12:27 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-10-31 12:12:27 +0000
commit1195ed3a69f40976977520f1cefac98cc614a319 (patch)
treeb1434f7ccf678b439f14ec465aca4553e82bc842 /mod/garbagecollector
parent0213b10b271be7bc8c3f8c8e7253164b08e7a618 (diff)
downloadelgg-1195ed3a69f40976977520f1cefac98cc614a319.tar.gz
elgg-1195ed3a69f40976977520f1cefac98cc614a319.tar.bz2
Changed cron to use output buffering (letting you simply echo rather than needing to pass variables around)
git-svn-id: https://code.elgg.org/elgg/trunk@2374 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/garbagecollector')
-rw-r--r--mod/garbagecollector/start.php28
1 files changed, 13 insertions, 15 deletions
diff --git a/mod/garbagecollector/start.php b/mod/garbagecollector/start.php
index 764925d59..940b611ae 100644
--- a/mod/garbagecollector/start.php
+++ b/mod/garbagecollector/start.php
@@ -37,39 +37,37 @@
{
global $CONFIG;
- $resulttext = elgg_echo('garbagecollector');
+ echo elgg_echo('garbagecollector');
// Garbage collect metastrings
- $resulttext .= elgg_echo('garbagecollector:gc:metastrings');
+ echo elgg_echo('garbagecollector:gc:metastrings');
if (delete_orphaned_metastrings()!==false) {
- $resulttext .= elgg_echo('garbagecollector:ok');
+ echo elgg_echo('garbagecollector:ok');
} else
- $resulttext .= elgg_echo('garbagecollector:error');
+ echo elgg_echo('garbagecollector:error');
- $resulttext .= "\n";
+ echo "\n";
// Now, because we are nice, trigger a plugin hook to let other plugins do some GC
- $returnvalue = true;
+ $rv = true;
$period = get_plugin_setting('period','garbagecollector');
- $returnvalue = trigger_plugin_hook('system', 'gc', array('period' => $period));
-
+ trigger_plugin_hook('system', 'gc', array('period' => $period));
+
// Now we optimize all tables
$tables = get_db_tables();
foreach ($tables as $table) {
- $resulttext .= sprintf(elgg_echo('garbagecollector:optimize'), $table);
+ echo sprintf(elgg_echo('garbagecollector:optimize'), $table);
if (optimize_table($table)!==false)
- $resulttext .= elgg_echo('garbagecollector:ok');
+ echo elgg_echo('garbagecollector:ok');
else
- $resulttext .= elgg_echo('garbagecollector:error');
+ echo elgg_echo('garbagecollector:error');
- $resulttext .= "\n";
+ echo "\n";
}
- $resulttext .= elgg_echo('garbagecollector:done');
-
- return $returnvalue . $resulttext;
+ echo elgg_echo('garbagecollector:done');
}
// Initialise plugin