From 4669a3e824915d3c8418de1f6b17a6811441c617 Mon Sep 17 00:00:00 2001 From: marcus Date: Fri, 31 Oct 2008 10:33:20 +0000 Subject: Closes #493: Moved database queries out of module and in to core in line with best practice. git-svn-id: https://code.elgg.org/elgg/trunk@2369 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/garbagecollector/start.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'mod') diff --git a/mod/garbagecollector/start.php b/mod/garbagecollector/start.php index f92248cc0..a3daf250e 100644 --- a/mod/garbagecollector/start.php +++ b/mod/garbagecollector/start.php @@ -41,16 +41,8 @@ // Garbage collect metastrings $resulttext .= elgg_echo('garbagecollector:gc:metastrings'); - $query = " - DELETE - from {$CONFIG->dbprefix}metastrings where - ( - (id not in (select name_id from {$CONFIG->dbprefix}metadata)) AND - (id not in (select value_id from {$CONFIG->dbprefix}metadata)) AND - (id not in (select name_id from {$CONFIG->dbprefix}annotations)) AND - (id not in (select value_id from {$CONFIG->dbprefix}annotations)) - )"; - if (delete_data($query)!==false) { + + if (delete_orphaned_metastrings()!==false) { $resulttext .= elgg_echo('garbagecollector:ok'); } else $resulttext .= elgg_echo('garbagecollector:error'); @@ -62,7 +54,7 @@ foreach ($tables as $table) { $resulttext .= sprintf(elgg_echo('garbagecollector:optimize'), $table); - if (update_data("optimize table $table")!==false) + if (optimize_table($table)!==false) $resulttext .= elgg_echo('garbagecollector:ok'); else $resulttext .= elgg_echo('garbagecollector:error'); -- cgit v1.2.3