diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gallery/config/cache.php | 31 | ||||
-rw-r--r-- | modules/gallery/libraries/drivers/Cache/Database.php | 12 | ||||
-rw-r--r-- | modules/gallery/tests/Gallery_Installer_Test.php | 3 |
3 files changed, 30 insertions, 16 deletions
diff --git a/modules/gallery/config/cache.php b/modules/gallery/config/cache.php index 5f2cd6de..cc3ac87d 100644 --- a/modules/gallery/config/cache.php +++ b/modules/gallery/config/cache.php @@ -1,5 +1,23 @@ -<?php defined('SYSPATH') OR die('No direct access allowed.'); +<?php defined("SYSPATH") or die("No direct script access."); /** + * Gallery - a web based photo album viewer and editor + * Copyright (C) 2000-2009 Bharat Mediratta + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + */ +/* * @package Cache * * Cache settings, defined as arrays, or "groups". If no group name is @@ -23,10 +41,9 @@ * caches are deleted. This is commonly referred to as "garbage collection". * Setting this to 0 or a negative number will disable automatic garbage collection. */ -$config['default'] = array -( - 'driver' => 'database', - 'params' => null, - 'lifetime' => 84600, - 'requests' => 1000 +$config["default"] = array ( + "driver" => "database", + "params" => null, + "lifetime" => 84600, + "requests" => 1000 ); diff --git a/modules/gallery/libraries/drivers/Cache/Database.php b/modules/gallery/libraries/drivers/Cache/Database.php index e008f473..70235e05 100644 --- a/modules/gallery/libraries/drivers/Cache/Database.php +++ b/modules/gallery/libraries/drivers/Cache/Database.php @@ -1,4 +1,4 @@ -<?php defined('SYSPATH') OR die('No direct access allowed.'); +<?php defined("SYSPATH") or die("No direct script access."); /** * Gallery - a web based photo album viewer and editor * Copyright (C) 2000-2009 Bharat Mediratta @@ -32,9 +32,9 @@ class Cache_Database_Driver implements Cache_Driver { $this->db = Database::instance(); if (!$this->db->table_exists("caches")) { - throw new Kohana_Exception('cache.driver_error', "Cache table is not defined"); + throw new Kohana_Exception("cache.driver_error", "Cache table is not defined"); } - Kohana::log('debug', 'Cache Database Driver Initialized'); + Kohana::log("debug", "Cache Database Driver Initialized"); } /** @@ -44,7 +44,7 @@ class Cache_Database_Driver implements Cache_Driver { * @return boolean */ public function exists($id) { - $count = $this->db->count_records("caches", array('id' => $id, "expiration >=" => time())); + $count = $this->db->count_records("caches", array("id" => $id, "expiration >=" => time())); return $count > 0; } @@ -60,7 +60,7 @@ class Cache_Database_Driver implements Cache_Driver { public function set($id, $data, array $tags = NULL, $lifetime) { if (!empty($tags)) { // Escape the tags, adding brackets so the tag can be explicitly matched - $tags = '<' . implode('>,<', $tags) . '>'; + $tags = "<" . implode(">,<", $tags) . ">"; } // Cache Database driver expects unix timestamp @@ -120,7 +120,7 @@ class Cache_Database_Driver implements Cache_Driver { */ public function get($id) { $data = null; - $result = $this->db->getwhere("caches", array('id' => $id)); + $result = $this->db->getwhere("caches", array("id" => $id)); if (count($result) > 0) { $cache = $result->current(); diff --git a/modules/gallery/tests/Gallery_Installer_Test.php b/modules/gallery/tests/Gallery_Installer_Test.php index 001b7d26..27157d6e 100644 --- a/modules/gallery/tests/Gallery_Installer_Test.php +++ b/modules/gallery/tests/Gallery_Installer_Test.php @@ -31,9 +31,6 @@ class Gallery_Installer_Test extends Unit_Test_Case { public function install_registers_gallery_module_test() { $gallery = ORM::factory("module")->where("name", "gallery")->find(); $this->assert_equal("gallery", $gallery->name); - - // This is probably too volatile to keep for long - $this->assert_equal(2, $gallery->version); } public function install_creates_root_item_test() { |