diff options
-rw-r--r-- | engine/handlers/cron_handler.php | 9 | ||||
-rw-r--r-- | mod/garbagecollector/start.php | 28 |
2 files changed, 20 insertions, 17 deletions
diff --git a/engine/handlers/cron_handler.php b/engine/handlers/cron_handler.php index acc24541c..816fb2c51 100644 --- a/engine/handlers/cron_handler.php +++ b/engine/handlers/cron_handler.php @@ -27,8 +27,13 @@ // Trigger hack $std_out = ""; // Data to return to - $std_out = trigger_plugin_hook('cron', $period, $params, $std_out); + $old_stdout = ""; + ob_start(); + + $old_stdout = trigger_plugin_hook('cron', $period, $params, $old_stdout); + + $std_out = ob_get_clean(); // Return event - echo $std_out; + echo $std_out . $old_stdout; ?>
\ No newline at end of file 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 |