From: Chuck Hagenbuch Date: Fri, 12 Nov 2010 04:20:58 +0000 (-0500) Subject: WS X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=1d219d6b5a769cc5e0d7c3d3f69ced7ba71ded48;p=horde.git WS --- diff --git a/ansel/lib/Gallery.php b/ansel/lib/Gallery.php index fc55b533c..a214ec1a9 100644 --- a/ansel/lib/Gallery.php +++ b/ansel/lib/Gallery.php @@ -972,5 +972,4 @@ class Ansel_Gallery extends Horde_Share_Object_Sql_Hierarchical $GLOBALS['injector']->getInstance('Ansel_Injector_Factory_Storage')->create()->shares->initShareObject($this); $this->_setModeHelper($this->get('view_mode')); } - } diff --git a/ansel/lib/Image.php b/ansel/lib/Image.php index f7ec8b0ea..1492290a9 100644 --- a/ansel/lib/Image.php +++ b/ansel/lib/Image.php @@ -1354,5 +1354,4 @@ class Ansel_Image Implements Iterator return $newImage; } - } diff --git a/ansel/lib/Injector/Factory/Storage.php b/ansel/lib/Injector/Factory/Storage.php index 0b691be2f..9eff18b58 100644 --- a/ansel/lib/Injector/Factory/Storage.php +++ b/ansel/lib/Injector/Factory/Storage.php @@ -40,7 +40,6 @@ class Ansel_Injector_Factory_Storage $this->_instances[$scope] = new Ansel_Storage($this->_injector->getInstance('Horde_Core_Factory_Share')->create($scope, 'Sql_Hierarchical')); } - return $this->_instances[$scope]; + return $this->_instances[$scope]; } - -} \ No newline at end of file +} diff --git a/ansel/lib/Storage.php b/ansel/lib/Storage.php index 9d71991fc..237983c39 100644 --- a/ansel/lib/Storage.php +++ b/ansel/lib/Storage.php @@ -294,29 +294,29 @@ class Ansel_Storage */ public function getGallery($gallery_id, $overrides = array()) { - if (!count($overrides) && $GLOBALS['conf']['ansel_cache']['usecache'] && - ($gallery = $GLOBALS['injector']->getInstance('Horde_Cache')->get('Ansel_Gallery' . $gallery_id, $GLOBALS['conf']['cache']['default_lifetime'])) !== false) { - - $cached_gallery = @unserialize($gallery); - if ($cached_gallery) { return $cached_gallery; } - } - - try { - $result = $this->_shares->getShareById($gallery_id); - } catch (Horde_Share_Exception $e) { - throw new Ansel_Exception($e); - } - - // Don't cache if we have overridden anything - if (!count($overrides)) { - if ($GLOBALS['conf']['ansel_cache']['usecache']) { - $GLOBALS['injector']->getInstance('Horde_Cache')->set('Ansel_Gallery' . $gallery_id, serialize($result)); - } - } else { - foreach ($overrides as $key => $value) { - $result->set($key, $value, false); - } - } + if (!count($overrides) && $GLOBALS['conf']['ansel_cache']['usecache'] && + ($gallery = $GLOBALS['injector']->getInstance('Horde_Cache')->get('Ansel_Gallery' . $gallery_id, $GLOBALS['conf']['cache']['default_lifetime'])) !== false) { + + $cached_gallery = unserialize($gallery); + if ($cached_gallery) { return $cached_gallery; } + } + + try { + $result = $this->_shares->getShareById($gallery_id); + } catch (Horde_Share_Exception $e) { + throw new Ansel_Exception($e); + } + + // Don't cache if we have overridden anything + if (!count($overrides)) { + if ($GLOBALS['conf']['ansel_cache']['usecache']) { + $GLOBALS['injector']->getInstance('Horde_Cache')->set('Ansel_Gallery' . $gallery_id, serialize($result)); + } + } else { + foreach ($overrides as $key => $value) { + $result->set($key, $value, false); + } + } return $result; } @@ -1165,7 +1165,6 @@ class Ansel_Storage */ public function getHashes() { - $hashes = $this->_db->query('SELECT style_hash FROM ansel_hashes;'); + $hashes = $this->_db->query('SELECT style_hash FROM ansel_hashes'); } - }