aboutsummaryrefslogtreecommitdiff
path: root/mod/garbagecollector/start.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/garbagecollector/start.php')
-rw-r--r--mod/garbagecollector/start.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/mod/garbagecollector/start.php b/mod/garbagecollector/start.php
index 63d8e7f2a..e3f8c030f 100644
--- a/mod/garbagecollector/start.php
+++ b/mod/garbagecollector/start.php
@@ -1,7 +1,7 @@
<?php
/**
* Elgg garbage collector.
- *
+ *
* @package ElggGarbageCollector
*/
@@ -16,15 +16,15 @@
{
case 'weekly':
case 'monthly' :
- case 'yearly' :
+ case 'yearly' :
break;
default: $period = 'monthly';
}
-
+
// Register cron hook
register_plugin_hook('cron', $period, 'garbagecollector_cron');
}
-
+
/**
* Cron job
*
@@ -32,29 +32,29 @@
function garbagecollector_cron($hook, $entity_type, $returnvalue, $params)
{
global $CONFIG;
-
+
echo elgg_echo('garbagecollector');
-
+
// Garbage collect metastrings
echo elgg_echo('garbagecollector:gc:metastrings');
-
+
if (delete_orphaned_metastrings()!==false) {
echo elgg_echo('garbagecollector:ok');
} else
echo elgg_echo('garbagecollector:error');
-
+
echo "\n";
-
+
// Now, because we are nice, trigger a plugin hook to let other plugins do some GC
$rv = true;
$period = get_plugin_setting('period','garbagecollector');
trigger_plugin_hook('gc', 'system', array('period' => $period));
-
+
// Now we optimize all tables
$tables = get_db_tables();
foreach ($tables as $table) {
- echo sprintf(elgg_echo('garbagecollector:optimize'), $table);
-
+ echo elgg_echo('garbagecollector:optimize', array($table));
+
if (optimize_table($table)!==false)
echo elgg_echo('garbagecollector:ok');
else
@@ -62,10 +62,10 @@
echo "\n";
}
-
+
echo elgg_echo('garbagecollector:done');
}
-
+
// Initialise plugin
register_elgg_event_handler('init','system','garbagecollector_init');
?> \ No newline at end of file