diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-06-28 22:49:35 +0800 | 
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-06-28 22:52:35 +0800 | 
| commit | 1c44537097e01f50c6c2840d0020d6a2406e2878 (patch) | |
| tree | 0cb5fcc93f7d682239a22f8d43f559ee56019e3b /modules/gallery/libraries/drivers/Cache/Database.php | |
| parent | 067e9f8ef7c7ed5763a5290b0e8d2f4a48123a86 (diff) | |
Clean up code (i.e. preamble, tabs) from the caching implementation so the unit tests pass
Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
Diffstat (limited to 'modules/gallery/libraries/drivers/Cache/Database.php')
| -rw-r--r-- | modules/gallery/libraries/drivers/Cache/Database.php | 12 | 
1 files changed, 6 insertions, 6 deletions
| 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(); | 
