Fix class names.
authorJan Schneider <jan@horde.org>
Tue, 16 Nov 2010 14:42:41 +0000 (15:42 +0100)
committerJan Schneider <jan@horde.org>
Tue, 16 Nov 2010 14:50:45 +0000 (15:50 +0100)
30 files changed:
framework/Cache/lib/Horde/Cache.php
framework/Cache/lib/Horde/Cache/Storage.php [deleted file]
framework/Cache/lib/Horde/Cache/Storage/Apc.php
framework/Cache/lib/Horde/Cache/Storage/Base.php [new file with mode: 0644]
framework/Cache/lib/Horde/Cache/Storage/Eaccelerator.php
framework/Cache/lib/Horde/Cache/Storage/File.php
framework/Cache/lib/Horde/Cache/Storage/Memcache.php
framework/Cache/lib/Horde/Cache/Storage/Mock.php
framework/Cache/lib/Horde/Cache/Storage/Null.php
framework/Cache/lib/Horde/Cache/Storage/Session.php
framework/Cache/lib/Horde/Cache/Storage/Sql.php
framework/Cache/lib/Horde/Cache/Storage/Stack.php
framework/Cache/lib/Horde/Cache/Storage/Xcache.php
framework/Cache/package.xml
framework/Core/lib/Horde/Core/Prefs/Cache/Session.php
framework/Core/lib/Horde/Core/Prefs/Storage/Configuration.php
framework/Core/lib/Horde/Core/Prefs/Storage/Hooks.php
framework/Prefs/lib/Horde/Prefs/Cache.php [deleted file]
framework/Prefs/lib/Horde/Prefs/Cache/Base.php [new file with mode: 0644]
framework/Prefs/lib/Horde/Prefs/Cache/Null.php
framework/Prefs/lib/Horde/Prefs/Cache/Session.php
framework/Prefs/lib/Horde/Prefs/Storage.php [deleted file]
framework/Prefs/lib/Horde/Prefs/Storage/Base.php [new file with mode: 0644]
framework/Prefs/lib/Horde/Prefs/Storage/File.php
framework/Prefs/lib/Horde/Prefs/Storage/Imsp.php
framework/Prefs/lib/Horde/Prefs/Storage/KolabImap.php
framework/Prefs/lib/Horde/Prefs/Storage/Ldap.php
framework/Prefs/lib/Horde/Prefs/Storage/Null.php
framework/Prefs/lib/Horde/Prefs/Storage/Sql.php
framework/Prefs/package.xml

index 7c9e07e..7507c1f 100644 (file)
@@ -54,7 +54,7 @@ class Horde_Cache
      * 'logger' - (Horde_Log_Logger) Log object to use for log/debug messages.
      * </pre>
      */
-    public function __construct(Horde_Cache_Storage $storage,
+    public function __construct(Horde_Cache_Storage_Base $storage,
                                 array $params = array())
     {
         if (isset($params['logger'])) {
diff --git a/framework/Cache/lib/Horde/Cache/Storage.php b/framework/Cache/lib/Horde/Cache/Storage.php
deleted file mode 100644 (file)
index 6db05d2..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-/**
- * This class provides the abstract implementation of the cache storage
- * driver.
- *
- * Copyright 2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @author   Michael Slusarz <slusarz@horde.org>
- * @category Horde
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @package  Cache
- */
-abstract class Horde_Cache_Storage
-{
-    /**
-     * Logger.
-     *
-     * @var Horde_Log_Logger
-     */
-    protected $_logger;
-
-    /**
-     * Parameters.
-     *
-     * @var array
-     */
-    protected $_params = array();
-
-    /**
-     * Constructor.
-     *
-     * @param array $params  Configuration parameters.
-     */
-    public function __construct(array $params = array())
-    {
-        $this->_params = array_merge($this->_params, $params);
-    }
-
-    /**
-     * Set the logging object.
-     *
-     * @param Horde_Log_Logger $logger  Log object.
-     */
-    public function setLogger($logger)
-    {
-        $this->_logger = $logger;
-    }
-
-    /**
-     * Retrieve cached data.
-     *
-     * @param string $key        Object ID to query.
-     * @param integer $lifetime  Lifetime of the object in seconds.
-     *
-     * @return mixed  Cached data, or false if none was found.
-     */
-    abstract public function get($key, $lifetime);
-
-    /**
-     * Store an object in the cache.
-     *
-     * @param string $key        Object ID used as the caching key.
-     * @param mixed $data        Data to store in the cache.
-     * @param integer $lifetime  Object lifetime - i.e. the time before the
-     *                           data becomes available for garbage
-     *                           collection. If 0 will not be GC'd.
-     */
-    abstract public function set($key, $data, $lifetime);
-
-    /**
-     * Checks if a given key exists in the cache, valid for the given
-     * lifetime.
-     *
-     * @param string $key        Cache key to check.
-     * @param integer $lifetime  Lifetime of the key in seconds.
-     *
-     * @return boolean  Existence.
-     */
-    abstract public function exists($key, $lifetime);
-
-    /**
-     * Expire any existing data for the given key.
-     *
-     * @param string $key  Cache key to expire.
-     *
-     * @return boolean  Success or failure.
-     */
-    abstract public function expire($key);
-
-}
index 12ea3a3..832a8fd 100644 (file)
@@ -12,7 +12,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Cache
  */
-class Horde_Cache_Storage_Apc extends Horde_Cache_Storage
+class Horde_Cache_Storage_Apc extends Horde_Cache_Storage_Base
 {
     /**
      */
diff --git a/framework/Cache/lib/Horde/Cache/Storage/Base.php b/framework/Cache/lib/Horde/Cache/Storage/Base.php
new file mode 100644 (file)
index 0000000..18666bc
--- /dev/null
@@ -0,0 +1,93 @@
+<?php
+/**
+ * This class provides the abstract implementation of the cache storage
+ * driver.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @author   Michael Slusarz <slusarz@horde.org>
+ * @category Horde
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package  Cache
+ */
+abstract class Horde_Cache_Storage_Base
+{
+    /**
+     * Logger.
+     *
+     * @var Horde_Log_Logger
+     */
+    protected $_logger;
+
+    /**
+     * Parameters.
+     *
+     * @var array
+     */
+    protected $_params = array();
+
+    /**
+     * Constructor.
+     *
+     * @param array $params  Configuration parameters.
+     */
+    public function __construct(array $params = array())
+    {
+        $this->_params = array_merge($this->_params, $params);
+    }
+
+    /**
+     * Set the logging object.
+     *
+     * @param Horde_Log_Logger $logger  Log object.
+     */
+    public function setLogger($logger)
+    {
+        $this->_logger = $logger;
+    }
+
+    /**
+     * Retrieve cached data.
+     *
+     * @param string $key        Object ID to query.
+     * @param integer $lifetime  Lifetime of the object in seconds.
+     *
+     * @return mixed  Cached data, or false if none was found.
+     */
+    abstract public function get($key, $lifetime);
+
+    /**
+     * Store an object in the cache.
+     *
+     * @param string $key        Object ID used as the caching key.
+     * @param mixed $data        Data to store in the cache.
+     * @param integer $lifetime  Object lifetime - i.e. the time before the
+     *                           data becomes available for garbage
+     *                           collection. If 0 will not be GC'd.
+     */
+    abstract public function set($key, $data, $lifetime);
+
+    /**
+     * Checks if a given key exists in the cache, valid for the given
+     * lifetime.
+     *
+     * @param string $key        Cache key to check.
+     * @param integer $lifetime  Lifetime of the key in seconds.
+     *
+     * @return boolean  Existence.
+     */
+    abstract public function exists($key, $lifetime);
+
+    /**
+     * Expire any existing data for the given key.
+     *
+     * @param string $key  Cache key to expire.
+     *
+     * @return boolean  Success or failure.
+     */
+    abstract public function expire($key);
+
+}
index 1a58a1b..7575ef7 100644 (file)
@@ -12,7 +12,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Cache
  */
-class Horde_Cache_Storage_Eaccelerator extends Horde_Cache_Storage
+class Horde_Cache_Storage_Eaccelerator extends Horde_Cache_Storage_Base
 {
     /**
      * @throws Horde_Cache_Exception
index 84cae41..9f0c7ee 100644 (file)
@@ -14,7 +14,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Cache
  */
-class Horde_Cache_Storage_File extends Horde_Cache_Storage
+class Horde_Cache_Storage_File extends Horde_Cache_Storage_Base
 {
     /* Location of the garbage collection data file. */
     const GC_FILE = 'horde_cache_gc';
index 484d41c..00760e4 100644 (file)
@@ -15,7 +15,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Cache
  */
-class Horde_Cache_Storage_Memcache extends Horde_Cache_Storage implements Serializable
+class Horde_Cache_Storage_Memcache extends Horde_Cache_Storage_Base implements Serializable
 {
     /**
      * Cache results of expire() calls (since we will get the entire object
index 735241f..6f43c30 100644 (file)
@@ -15,7 +15,7 @@
  * @link     http://pear.horde.org/index.php?package=Cache
  * @package  Cache
  */
-class Horde_Cache_Storage_Mock extends Horde_Cache_Storage
+class Horde_Cache_Storage_Mock extends Horde_Cache_Storage_Base
 {
     /**
      * The storage location for this cache.
index 36b88ec..73d6261 100644 (file)
@@ -12,7 +12,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Cache
  */
-class Horde_Cache_Storage_Null extends Horde_Cache_Storage
+class Horde_Cache_Storage_Null extends Horde_Cache_Storage_Base
 {
     /**
      */
index 3a5d75f..c0b0aec 100644 (file)
@@ -12,7 +12,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Cache
  */
-class Horde_Cache_Storage_Session extends Horde_Cache_Storage
+class Horde_Cache_Storage_Session extends Horde_Cache_Storage_Base
 {
     /**
      * Pointer to the session entry.
index c17e3d4..f518a45 100644 (file)
@@ -28,7 +28,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Cache
  */
-class Horde_Cache_Storage_Sql extends Horde_Cache_Storage
+class Horde_Cache_Storage_Sql extends Horde_Cache_Storage_Base
 {
     /**
      * Handle for the current database connection.
index 6362a61..f22ea85 100644 (file)
@@ -14,7 +14,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Cache
  */
-class Horde_Cache_Storage_Stack extends Horde_Cache_Storage
+class Horde_Cache_Storage_Stack extends Horde_Cache_Storage_Base
 {
     /**
      * Stack of cache drivers.
index 0c71248..4789469 100644 (file)
@@ -12,7 +12,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Cache
  */
-class Horde_Cache_Storage_Xcache extends Horde_Cache_Storage
+class Horde_Cache_Storage_Xcache extends Horde_Cache_Storage_Base
 {
     /**
      */
index 82c6939..29036fe 100644 (file)
@@ -1,16 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.4.9" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
-http://pear.php.net/dtd/tasks-1.0.xsd
-http://pear.php.net/dtd/package-2.0
-http://pear.php.net/dtd/package-2.0.xsd">
+<package packagerversion="1.9.1" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd">
  <name>Cache</name>
  <channel>pear.horde.org</channel>
  <summary>Horde Caching API</summary>
  <description>This package provides a simple, functional caching API,
 with the option to store the cached data on the filesystem, in one of
 the PHP opcode cache systems (APC, eAcclerator, XCache, or Zend
-Performance Suite&apos;s content cache), memcached, or an SQL table.
- </description>
+Performance Suite&apos;s content cache), memcached, or an SQL table.</description>
  <lead>
   <name>Chuck Hagenbuch</name>
   <user>chuck</user>
@@ -23,7 +19,8 @@ Performance Suite&apos;s content cache), memcached, or an SQL table.
   <email>slusarz@horde.org</email>
   <active>yes</active>
  </lead>
- <date>2008-03-04</date>
+ <date>2010-11-16</date>
+ <time>15:41:39</time>
  <version>
   <release>0.2.0</release>
   <api>0.2.0</api>
@@ -33,15 +30,17 @@ Performance Suite&apos;s content cache), memcached, or an SQL table.
   <api>beta</api>
  </stability>
  <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Abstracted storage-specific code into &apos;Storage&apos; drivers.
+ <notes>
+* Abstracted storage-specific code into &apos;Storage&apos; drivers.
  * Add option to transparently compress cache data using lzf.
  * Added Horde_Cache_Session::.
  * Horde_Cache::set() no longer returns a boolean result.
  * Added Horde_Cache_Exception::.
  * Removed dependency on Horde Core.
- * Initial Horde 4 package.</notes>
+ * Initial Horde 4 package.
+ </notes>
  <contents>
-  <dir name="/">
+  <dir baseinstalldir="/" name="/">
    <dir name="data">
     <file name="cache.sql" role="data" />
    </dir> <!-- /data -->
@@ -50,6 +49,7 @@ Performance Suite&apos;s content cache), memcached, or an SQL table.
      <dir name="Cache">
       <dir name="Storage">
        <file name="Apc.php" role="php" />
+       <file name="Base.php" role="php" />
        <file name="Eaccelerator.php" role="php" />
        <file name="File.php" role="php" />
        <file name="Memcache.php" role="php" />
@@ -61,7 +61,6 @@ Performance Suite&apos;s content cache), memcached, or an SQL table.
        <file name="Xcache.php" role="php" />
       </dir> <!-- /lib/Horde/Cache/Storage -->
       <file name="Exception.php" role="php" />
-      <file name="Storage.php" role="php" />
      </dir> <!-- /lib/Horde/Cache -->
      <file name="Cache.php" role="php" />
     </dir> <!-- /lib/Horde -->
@@ -113,23 +112,39 @@ Performance Suite&apos;s content cache), memcached, or an SQL table.
  </dependencies>
  <phprelease>
   <filelist>
-   <install name="lib/Horde/Cache/Storage/Apc.php" as="Horde/Cache/Storage/Apc.php" />
-   <install name="lib/Horde/Cache/Storage/Eaccelerator.php" as="Horde/Cache/Storage/Eaccelerator.php" />
-   <install name="lib/Horde/Cache/Storage/File.php" as="Horde/Cache/Storage/File.php" />
-   <install name="lib/Horde/Cache/Storage/Memcache.php" as="Horde/Cache/Storage/Memcache.php" />
-   <install name="lib/Horde/Cache/Storage/Mock.php" as="Horde/Cache/Storage/Mock.php" />
-   <install name="lib/Horde/Cache/Storage/Null.php" as="Horde/Cache/Storage/Null.php" />
-   <install name="lib/Horde/Cache/Storage/Session.php" as="Horde/Cache/Storage/Session.php" />
-   <install name="lib/Horde/Cache/Storage/Sql.php" as="Horde/Cache/Storage/Sql.php" />
-   <install name="lib/Horde/Cache/Storage/Stack.php" as="Horde/Cache/Storage/Stack.php" />
-   <install name="lib/Horde/Cache/Storage/Xcache.php" as="Horde/Cache/Storage/Xcache.php" />
-   <install name="lib/Horde/Cache/Exception.php" as="Horde/Cache/Exception.php" />
-   <install name="lib/Horde/Cache/Storage.php" as="Horde/Cache/Storage.php" />
-   <install name="lib/Horde/Cache.php" as="Horde/Cache.php" />
+   <install as="cache.sql" name="data/cache.sql" />
+   <install as="Horde/Cache.php" name="lib/Horde/Cache.php" />
+   <install as="Horde/Cache/Exception.php" name="lib/Horde/Cache/Exception.php" />
+   <install as="Horde/Cache/Storage/Apc.php" name="lib/Horde/Cache/Storage/Apc.php" />
+   <install as="Horde/Cache/Storage/Base.php" name="lib/Horde/Cache/Storage/Base.php" />
+   <install as="Horde/Cache/Storage/Eaccelerator.php" name="lib/Horde/Cache/Storage/Eaccelerator.php" />
+   <install as="Horde/Cache/Storage/File.php" name="lib/Horde/Cache/Storage/File.php" />
+   <install as="Horde/Cache/Storage/Memcache.php" name="lib/Horde/Cache/Storage/Memcache.php" />
+   <install as="Horde/Cache/Storage/Mock.php" name="lib/Horde/Cache/Storage/Mock.php" />
+   <install as="Horde/Cache/Storage/Null.php" name="lib/Horde/Cache/Storage/Null.php" />
+   <install as="Horde/Cache/Storage/Session.php" name="lib/Horde/Cache/Storage/Session.php" />
+   <install as="Horde/Cache/Storage/Sql.php" name="lib/Horde/Cache/Storage/Sql.php" />
+   <install as="Horde/Cache/Storage/Stack.php" name="lib/Horde/Cache/Storage/Stack.php" />
+   <install as="Horde/Cache/Storage/Xcache.php" name="lib/Horde/Cache/Storage/Xcache.php" />
   </filelist>
  </phprelease>
  <changelog>
   <release>
+   <version>
+    <release>0.0.1</release>
+    <api>0.0.1</api>
+   </version>
+   <stability>
+    <release>alpha</release>
+    <api>alpha</api>
+   </stability>
+   <date>2004-01-01</date>
+   <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
+   <notes>
+Initial packaging.
+   </notes>
+  </release>
+  <release>
    <date>2006-05-08</date>
    <version>
     <release>0.1.0</release>
@@ -140,23 +155,31 @@ Performance Suite&apos;s content cache), memcached, or an SQL table.
     <api>beta</api>
    </stability>
    <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
-   <notes>* Add SQL backend.
+   <notes>
+* Add SQL backend.
 * Converted to package.xml 2.0 for pear.horde.org.
 * Add APC, eAccelerator, and XCache backends (duck@obala.net).
    </notes>
   </release>
   <release>
    <version>
-    <release>0.0.1</release>
-    <api>0.0.1</api>
+    <release>0.2.0</release>
+    <api>0.2.0</api>
    </version>
    <stability>
-    <release>alpha</release>
-    <api>alpha</api>
+    <release>beta</release>
+    <api>beta</api>
    </stability>
-   <date>2004-01-01</date>
+   <date>2010-11-16</date>
    <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
-   <notes>Initial packaging.
+   <notes>
+* Abstracted storage-specific code into &apos;Storage&apos; drivers.
+ * Add option to transparently compress cache data using lzf.
+ * Added Horde_Cache_Session::.
+ * Horde_Cache::set() no longer returns a boolean result.
+ * Added Horde_Cache_Exception::.
+ * Removed dependency on Horde Core.
+ * Initial Horde 4 package.
    </notes>
   </release>
  </changelog>
index 6bb8fdb..45e4911 100644 (file)
@@ -12,7 +12,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Core
  */
-class Horde_Core_Prefs_Cache_Session extends Horde_Prefs_Cache
+class Horde_Core_Prefs_Cache_Session extends Horde_Prefs_Cache_Base
 {
     const SESS_KEY = 'prefs_cache/';
 
index b35a809..30c0d6a 100644 (file)
@@ -13,7 +13,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Core
  */
-class Horde_Core_Prefs_Storage_Configuration extends Horde_Prefs_Storage
+class Horde_Core_Prefs_Storage_Configuration extends Horde_Prefs_Storage_Base
 {
     /**
      * The list of preference hooks defined.
index 6332abe..4822a1c 100644 (file)
@@ -13,7 +13,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Core
  */
-class Horde_Core_Prefs_Storage_Hooks extends Horde_Prefs_Storage
+class Horde_Core_Prefs_Storage_Hooks extends Horde_Prefs_Storage_Base
 {
     /**
      */
diff --git a/framework/Prefs/lib/Horde/Prefs/Cache.php b/framework/Prefs/lib/Horde/Prefs/Cache.php
deleted file mode 100644 (file)
index 89e84ad..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-/**
- * Cache driver for the preferences system.
- *
- * Copyright 2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @author   Michael Slusarz <slusarz@horde.org>
- * @category Horde
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @package  Prefs
- */
-abstract class Horde_Prefs_Cache
-{
-    /**
-     * Configuration parameters.
-     * 'user' is always available as an entry.
-     *
-     * @var string
-     */
-    protected $_params = array();
-
-    /**
-     * Constructor.
-     *
-     * @param string $user   The username.
-     * @param array $params  Additional configuration parameters.
-     */
-    public function __construct($user, array $params = array())
-    {
-        $this->_params = array_merge($this->_params, $params);
-        $this->_params['user'] = $user;
-    }
-
-    /**
-     * Retrieves the requested preferences scope from the cache backend.
-     *
-     * @param string $scope  Scope specifier.
-     *
-     * @return mixed  Returns false if no data is available, otherwise the
-     *                Horde_Prefs_Scope object.
-     * @throws Horde_Prefs_Exception
-     */
-    abstract public function get($scope);
-
-    /**
-     * Stores preferences in the cache backend.
-     *
-     * @param Horde_Prefs_Scope $scope_ob  The scope object to store.
-     *
-     * @throws Horde_Prefs_Exception
-     */
-    abstract public function store($scope_ob);
-
-    /**
-     * Removes preferences from the cache.
-     *
-     * @param string $scope  The scope to remove. If null, clears entire
-     *                       cache.
-     *
-     * @throws Horde_Prefs_Exception
-     */
-    abstract public function remove($scope = null);
-
-}
diff --git a/framework/Prefs/lib/Horde/Prefs/Cache/Base.php b/framework/Prefs/lib/Horde/Prefs/Cache/Base.php
new file mode 100644 (file)
index 0000000..a8f6df7
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/**
+ * Cache driver for the preferences system.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @author   Michael Slusarz <slusarz@horde.org>
+ * @category Horde
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package  Prefs
+ */
+abstract class Horde_Prefs_Cache_Base
+{
+    /**
+     * Configuration parameters.
+     * 'user' is always available as an entry.
+     *
+     * @var string
+     */
+    protected $_params = array();
+
+    /**
+     * Constructor.
+     *
+     * @param string $user   The username.
+     * @param array $params  Additional configuration parameters.
+     */
+    public function __construct($user, array $params = array())
+    {
+        $this->_params = array_merge($this->_params, $params);
+        $this->_params['user'] = $user;
+    }
+
+    /**
+     * Retrieves the requested preferences scope from the cache backend.
+     *
+     * @param string $scope  Scope specifier.
+     *
+     * @return mixed  Returns false if no data is available, otherwise the
+     *                Horde_Prefs_Scope object.
+     * @throws Horde_Prefs_Exception
+     */
+    abstract public function get($scope);
+
+    /**
+     * Stores preferences in the cache backend.
+     *
+     * @param Horde_Prefs_Scope $scope_ob  The scope object to store.
+     *
+     * @throws Horde_Prefs_Exception
+     */
+    abstract public function store($scope_ob);
+
+    /**
+     * Removes preferences from the cache.
+     *
+     * @param string $scope  The scope to remove. If null, clears entire
+     *                       cache.
+     *
+     * @throws Horde_Prefs_Exception
+     */
+    abstract public function remove($scope = null);
+
+}
index cfe6562..a1b3219 100644 (file)
@@ -12,7 +12,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Prefs
  */
-class Horde_Prefs_Cache_Null extends Horde_Prefs_Cache
+class Horde_Prefs_Cache_Null extends Horde_Prefs_Cache_Base
 {
     /**
      */
index 0d2cb6a..ab7195f 100644 (file)
@@ -12,7 +12,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Prefs
  */
-class Horde_Prefs_Cache_Session extends Horde_Prefs_Cache
+class Horde_Prefs_Cache_Session extends Horde_Prefs_Cache_Base
 {
     /**
      * Session key.
diff --git a/framework/Prefs/lib/Horde/Prefs/Storage.php b/framework/Prefs/lib/Horde/Prefs/Storage.php
deleted file mode 100644 (file)
index 2f99ebd..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/**
- * Storage driver for the preferences system.
- *
- * Copyright 2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @author   Michael Slusarz <slusarz@horde.org>
- * @category Horde
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @package  Prefs
- */
-abstract class Horde_Prefs_Storage
-{
-    /**
-     * Configuration parameters.
-     * 'user' is always available as an entry.
-     *
-     * @var string
-     */
-    protected $_params = array();
-
-    /**
-     * Constructor.
-     *
-     * @param string $user   The username.
-     * @param array $params  Additional configuration parameters.
-     */
-    public function __construct($user, array $params = array())
-    {
-        $this->_params = array_merge($this->_params, $params);
-        $this->_params['user'] = $user;
-    }
-
-    /**
-     * Retrieves the requested preferences scope from the storage backend.
-     *
-     * @param Horde_Prefs_Scope $scope_ob  The scope object.
-     *
-     * @return Horde_Prefs_Scope  The modified scope object.
-     * @throws Horde_Prefs_Exception
-     */
-    abstract public function get($scope_ob);
-
-    /**
-     * Stores changed preferences in the storage backend.
-     *
-     * @param Horde_Prefs_Scope $scope_ob  The scope object.
-     *
-     * @throws Horde_Prefs_Exception
-     */
-    abstract public function store($scope_ob);
-
-    /**
-     * Called whenever a preference value is changed.
-     *
-     * @param string $scope  Scope specifier.
-     * @param string $pref   The preference name.
-     */
-    public function onChange($scope, $pref)
-    {
-    }
-
-    /**
-     * Removes preferences from the backend.
-     *
-     * @param string $scope  The scope of the prefs to clear. If null, clears
-     *                       all scopes.
-     * @param string $pref   The pref to clear. If null, clears the entire
-     *                       scope.
-     *
-     * @throws Horde_Db_Exception
-     */
-    abstract public function remove($scope = null, $pref = null);
-
-}
diff --git a/framework/Prefs/lib/Horde/Prefs/Storage/Base.php b/framework/Prefs/lib/Horde/Prefs/Storage/Base.php
new file mode 100644 (file)
index 0000000..ec8176a
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/**
+ * Storage driver for the preferences system.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @author   Michael Slusarz <slusarz@horde.org>
+ * @category Horde
+ * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @package  Prefs
+ */
+abstract class Horde_Prefs_Storage_Base
+{
+    /**
+     * Configuration parameters.
+     * 'user' is always available as an entry.
+     *
+     * @var string
+     */
+    protected $_params = array();
+
+    /**
+     * Constructor.
+     *
+     * @param string $user   The username.
+     * @param array $params  Additional configuration parameters.
+     */
+    public function __construct($user, array $params = array())
+    {
+        $this->_params = array_merge($this->_params, $params);
+        $this->_params['user'] = $user;
+    }
+
+    /**
+     * Retrieves the requested preferences scope from the storage backend.
+     *
+     * @param Horde_Prefs_Scope $scope_ob  The scope object.
+     *
+     * @return Horde_Prefs_Scope  The modified scope object.
+     * @throws Horde_Prefs_Exception
+     */
+    abstract public function get($scope_ob);
+
+    /**
+     * Stores changed preferences in the storage backend.
+     *
+     * @param Horde_Prefs_Scope $scope_ob  The scope object.
+     *
+     * @throws Horde_Prefs_Exception
+     */
+    abstract public function store($scope_ob);
+
+    /**
+     * Called whenever a preference value is changed.
+     *
+     * @param string $scope  Scope specifier.
+     * @param string $pref   The preference name.
+     */
+    public function onChange($scope, $pref)
+    {
+    }
+
+    /**
+     * Removes preferences from the backend.
+     *
+     * @param string $scope  The scope of the prefs to clear. If null, clears
+     *                       all scopes.
+     * @param string $pref   The pref to clear. If null, clears the entire
+     *                       scope.
+     *
+     * @throws Horde_Db_Exception
+     */
+    abstract public function remove($scope = null, $pref = null);
+
+}
index a94c82f..27ce663 100644 (file)
@@ -12,7 +12,7 @@
  * @category Horde
  * @package  Prefs
  */
-class Horde_Prefs_Storage_File extends Horde_Prefs_Storage
+class Horde_Prefs_Storage_File extends Horde_Prefs_Storage_Base
 {
     /* Current version number of the data format */
     const VERSION = 2;
index a64a2c9..d171477 100644 (file)
@@ -11,7 +11,7 @@
  * @category Horde
  * @package  Prefs
  */
-class Horde_Prefs_Storage_Imsp extends Horde_Prefs_Storage
+class Horde_Prefs_Storage_Imsp extends Horde_Prefs_Storage_Base
 {
     /**
      * Boolean indicating whether or not we're connected to the IMSP server.
index d33c2b9..4c48cc3 100644 (file)
@@ -12,7 +12,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Prefs
  */
-class Horde_Prefs_Storage_KolabImap extends Horde_Prefs_Storage
+class Horde_Prefs_Storage_KolabImap extends Horde_Prefs_Storage_Base
 {
     /**
      * Handle for the current Kolab connection.
index de154ff..123f3b3 100644 (file)
@@ -13,7 +13,7 @@
  * @category Horde
  * @package  Prefs
  */
-class Horde_Prefs_Storage_Ldap extends Horde_Prefs_Storage
+class Horde_Prefs_Storage_Ldap extends Horde_Prefs_Storage_Base
 {
     /**
      * Handle for the current LDAP connection.
index de833f9..df2953f 100644 (file)
@@ -12,7 +12,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Prefs
  */
-class Horde_Prefs_Storage_Null extends Horde_Prefs_Storage
+class Horde_Prefs_Storage_Null extends Horde_Prefs_Storage_Base
 {
     /**
      */
index 9c5f338..ec9544b 100644 (file)
@@ -13,7 +13,7 @@
  * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
  * @package  Prefs
  */
-class Horde_Prefs_Storage_Sql extends Horde_Prefs_Storage
+class Horde_Prefs_Storage_Sql extends Horde_Prefs_Storage_Base
 {
     /**
      * Handle for the current database connection.
index 3f7898b..258d94b 100644 (file)
@@ -10,8 +10,8 @@
   <email>chuck@horde.org</email>
   <active>yes</active>
  </lead>
- <date>2010-10-22</date>
- <time>19:02:57</time>
+ <date>2010-11-16</date>
+ <time>15:41:42</time>
  <version>
   <release>0.1.0</release>
   <api>0.1.0</api>
@@ -21,7 +21,8 @@
   <api>beta</api>
  </stability>
  <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Abstract caching code into Horde_Prefs_Cache.
+ <notes>
+* Abstract caching code into Horde_Prefs_Cache.
  * Removed Horde_Prefs_Storage_Kolab driver.
  * Abstract storage code into Horde_Prefs_Storage.
  * Add array access API to Horde_Prefs.
     <dir name="Horde">
      <dir name="Prefs">
       <dir name="Cache">
+       <file name="Base.php" role="php" />
        <file name="Null.php" role="php" />
        <file name="Session.php" role="php" />
       </dir> <!-- /lib/Horde/Prefs/Cache -->
       <dir name="Storage">
+       <file name="Base.php" role="php" />
        <file name="File.php" role="php" />
        <file name="Imsp.php" role="php" />
        <file name="KolabImap.php" role="php" />
        <file name="Null.php" role="php" />
        <file name="Sql.php" role="php" />
       </dir> <!-- /lib/Horde/Prefs/Storage -->
-      <file name="Cache.php" role="php" />
       <file name="CategoryManager.php" role="php" />
       <file name="Exception.php" role="php" />
       <file name="Identity.php" role="php" />
       <file name="Scope.php" role="php" />
-      <file name="Storage.php" role="php" />
       <file name="Translation.php" role="php">
        <tasks:replace from="@data_dir@" to="data_dir" type="pear-config" />
       </file>
  <phprelease>
   <filelist>
    <install as="Horde/Prefs.php" name="lib/Horde/Prefs.php" />
-   <install as="Horde/Prefs/Cache.php" name="lib/Horde/Prefs/Cache.php" />
    <install as="Horde/Prefs/CategoryManager.php" name="lib/Horde/Prefs/CategoryManager.php" />
    <install as="Horde/Prefs/Exception.php" name="lib/Horde/Prefs/Exception.php" />
    <install as="Horde/Prefs/Identity.php" name="lib/Horde/Prefs/Identity.php" />
    <install as="Horde/Prefs/Scope.php" name="lib/Horde/Prefs/Scope.php" />
-   <install as="Horde/Prefs/Storage.php" name="lib/Horde/Prefs/Storage.php" />
    <install as="Horde/Prefs/Translation.php" name="lib/Horde/Prefs/Translation.php" />
+   <install as="Horde/Prefs/Cache/Base.php" name="lib/Horde/Prefs/Cache/Base.php" />
    <install as="Horde/Prefs/Cache/Null.php" name="lib/Horde/Prefs/Cache/Null.php" />
    <install as="Horde/Prefs/Cache/Session.php" name="lib/Horde/Prefs/Cache/Session.php" />
+   <install as="Horde/Prefs/Storage/Base.php" name="lib/Horde/Prefs/Storage/Base.php" />
    <install as="Horde/Prefs/Storage/File.php" name="lib/Horde/Prefs/Storage/File.php" />
    <install as="Horde/Prefs/Storage/Imsp.php" name="lib/Horde/Prefs/Storage/Imsp.php" />
    <install as="Horde/Prefs/Storage/KolabImap.php" name="lib/Horde/Prefs/Storage/KolabImap.php" />
@@ -521,10 +522,12 @@ Initial release as a PEAR package
     <release>beta</release>
     <api>beta</api>
    </stability>
-   <date>2010-10-22</date>
+   <date>2010-11-16</date>
    <license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
    <notes>
-* Abstract storage code into Horde_Prefs_Storage.
+* Abstract caching code into Horde_Prefs_Cache.
+ * Removed Horde_Prefs_Storage_Kolab driver.
+ * Abstract storage code into Horde_Prefs_Storage.
  * Add array access API to Horde_Prefs.
  * Remove dependency on horde/Core.
  * Use Horde_Db as backend for Sql driver.