diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-12-02 00:34:34 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-12-02 00:34:34 -0800 |
commit | d2cb217e20d44d7928a0910ac0375740de163bb3 (patch) | |
tree | 8b7a45adb4457cbd7ed291b8151cf330a13fbf10 /modules/exif | |
parent | c803cb29091d3b069077d7711a2485f75f274835 (diff) |
Convert more database calls over to the new format
- admin/maintenance page loads, the rebuild thumbs/resizes task works
- Fixed up some conversion bugs in the Cache driver
Diffstat (limited to 'modules/exif')
-rw-r--r-- | modules/exif/helpers/exif.php | 6 | ||||
-rw-r--r-- | modules/exif/helpers/exif_task.php | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/modules/exif/helpers/exif.php b/modules/exif/helpers/exif.php index d3a8c103..3177e7eb 100644 --- a/modules/exif/helpers/exif.php +++ b/modules/exif/helpers/exif.php @@ -139,7 +139,7 @@ class exif_Core { } static function stats() { - $missing_exif = Database::instance() + $missing_exif = db::build() ->select("items.id") ->from("items") ->join("exif_records", "items.id", "exif_records.item_id", "left") @@ -148,10 +148,10 @@ class exif_Core { ->where("exif_records.item_id", "=", null) ->or_where("exif_records.dirty", "=", 1) ->close() - ->get() + ->execute() ->count(); - $total_items = ORM::factory("item")->where("type", "photo")->count_all(); + $total_items = ORM::factory("item")->where("type", "=", "photo")->count_all(); if (!$total_items) { return array(0, 0, 0); } diff --git a/modules/exif/helpers/exif_task.php b/modules/exif/helpers/exif_task.php index 66f69790..e25e2405 100644 --- a/modules/exif/helpers/exif_task.php +++ b/modules/exif/helpers/exif_task.php @@ -20,10 +20,11 @@ class exif_task_Core { static function available_tasks() { // Delete extra exif_records - Database::instance()->query( - "DELETE FROM {exif_records} " . - "WHERE {exif_records}.`item_id` NOT IN " . - "(SELECT `id` FROM {items} WHERE {items}.`type` = 'photo')"); + db::build() + ->delete("exif_records") + ->where("item_id", "NOT IN", + db::build()->select("id")->from("items")->where("type", "=", "photo")) + ->execute(); list ($remaining, $total, $percent) = exif::stats(); return array(Task_Definition::factory() |