From 4502a13a5b67946e798789ff5420877391372fcd Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 25 Jun 2009 08:47:16 -0700 Subject: 1) rename the model proxy to digibug proxy 2) corresponding table name change to digibug_proxies 3) change the generate of a unique id to md5(rand()) 3) Remove the helper function as digibug::uuid is no longer required. --- modules/digibug/helpers/digibug.php | 57 --------------------------- modules/digibug/helpers/digibug_installer.php | 6 +-- modules/digibug/helpers/digibug_task.php | 4 +- 3 files changed, 5 insertions(+), 62 deletions(-) delete mode 100644 modules/digibug/helpers/digibug.php (limited to 'modules/digibug/helpers') diff --git a/modules/digibug/helpers/digibug.php b/modules/digibug/helpers/digibug.php deleted file mode 100644 index 46c9d945..00000000 --- a/modules/digibug/helpers/digibug.php +++ /dev/null @@ -1,57 +0,0 @@ -> 4; - $time_hi_and_version = $time_hi_and_version | 0x4000; - - /** - * Set the two most significant bits (bits 6 and 7) of the - * clock_seq_hi_and_reserved to zero and one, respectively. - */ - $clock_seq_hi_and_reserved = hexdec ( $clock_seq_hi_and_reserved ); - $clock_seq_hi_and_reserved = $clock_seq_hi_and_reserved >> 2; - $clock_seq_hi_and_reserved = $clock_seq_hi_and_reserved | 0x8000; - - return sprintf ('%08s-%04s-%04x-%04x-%012s', - $time_low, $time_mid, $time_hi_and_version, $clock_seq_hi_and_reserved, $node); - } -} diff --git a/modules/digibug/helpers/digibug_installer.php b/modules/digibug/helpers/digibug_installer.php index baff2075..120bd3ef 100644 --- a/modules/digibug/helpers/digibug_installer.php +++ b/modules/digibug/helpers/digibug_installer.php @@ -22,9 +22,9 @@ class digibug_installer { $version = module::get_version("digibug"); if ($version == 0) { Database::instance() - ->query("CREATE TABLE {proxies} ( + ->query("CREATE TABLE {digibug_proxies} ( `id` int(9) NOT NULL AUTO_INCREMENT, - `uuid` char(36) NOT NULL, + `uuid` char(32) NOT NULL, `request_date` TIMESTAMP NOT NULL DEFAULT current_timestamp, `item_id` int(9) NOT NULL, PRIMARY KEY (`id`)) @@ -39,7 +39,7 @@ class digibug_installer { } static function uninstall() { - Database::instance()->query("DROP TABLE IF EXISTS {proxies}"); + Database::instance()->query("DROP TABLE IF EXISTS {digibug_proxies}"); module::delete("digibug"); } } diff --git a/modules/digibug/helpers/digibug_task.php b/modules/digibug/helpers/digibug_task.php index 98f79731..08cd6feb 100644 --- a/modules/digibug/helpers/digibug_task.php +++ b/modules/digibug/helpers/digibug_task.php @@ -22,7 +22,7 @@ class digibug_task_Core { // Delete extra exif_records $expired_request_count = Database::instance()->query( "SELECT count(*) as print_requests - FROM {proxies} + FROM {digibug_proxies} WHERE `request_date` <= (CURDATE() - INTERVAL 10 DAY)")->current()->print_requests; return array(Task_Definition::factory() @@ -38,7 +38,7 @@ class digibug_task_Core { static function remove_expired($task) { $completed = $task->get("completed", 0); - $expired = ORM::factory("proxy") + $expired = ORM::factory("digibug_proxy") ->where("request_date <= (CURDATE() - INTERVAL 10 DAY)") ->find_all(); $remaining = $expired->count(); -- cgit v1.2.3