From: Michael M Slusarz Date: Thu, 25 Mar 2010 19:50:36 +0000 (-0600) Subject: Remove Horde_Core dependency for Cache; phpdoc X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=898136f146cabf99f63c7b29ff6b407f9747ed49;p=horde.git Remove Horde_Core dependency for Cache; phpdoc --- diff --git a/framework/Cache/lib/Horde/Cache.php b/framework/Cache/lib/Horde/Cache.php index ea6bdf9ce..347166c52 100644 --- a/framework/Cache/lib/Horde/Cache.php +++ b/framework/Cache/lib/Horde/Cache.php @@ -9,9 +9,10 @@ * 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 Anil Madhavapeddy - * @author Chuck Hagenbuch - * @package Horde_Cache + * @author Anil Madhavapeddy + * @author Chuck Hagenbuch + * @category Horde + * @package Cache */ class Horde_Cache { diff --git a/framework/Cache/lib/Horde/Cache/Apc.php b/framework/Cache/lib/Horde/Cache/Apc.php index c73a2d261..1416cc1b7 100644 --- a/framework/Cache/lib/Horde/Cache/Apc.php +++ b/framework/Cache/lib/Horde/Cache/Apc.php @@ -8,8 +8,9 @@ * 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 Duck - * @package Horde_Cache + * @author Duck + * @category Horde + * @package Cache */ class Horde_Cache_Apc extends Horde_Cache_Base { diff --git a/framework/Cache/lib/Horde/Cache/Base.php b/framework/Cache/lib/Horde/Cache/Base.php index d862587cd..5b2a46821 100644 --- a/framework/Cache/lib/Horde/Cache/Base.php +++ b/framework/Cache/lib/Horde/Cache/Base.php @@ -8,10 +8,11 @@ * 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 Anil Madhavapeddy - * @author Chuck Hagenbuch - * @author Michael Slusarz - * @package Horde_Cache + * @author Anil Madhavapeddy + * @author Chuck Hagenbuch + * @author Michael Slusarz + * @category Horde + * @package Cache */ abstract class Horde_Cache_Base { @@ -20,7 +21,9 @@ abstract class Horde_Cache_Base * * @var array */ - protected $_params = array(); + protected $_params = array( + 'lifetime' => 86400 + ); /** * Logger. @@ -41,18 +44,12 @@ abstract class Horde_Cache_Base */ public function __construct($params = array()) { - if (!isset($params['lifetime'])) { - $params['lifetime'] = isset($GLOBALS['conf']['cache']['default_lifetime']) - ? $GLOBALS['conf']['cache']['default_lifetime'] - : 86400; - } - if (isset($params['logger'])) { $this->_logger = $params['logger']; unset($params['logger']); } - $this->_params = $params; + $this->_params = array_merge($this->_params, $params); } /** diff --git a/framework/Cache/lib/Horde/Cache/Eaccelerator.php b/framework/Cache/lib/Horde/Cache/Eaccelerator.php index 4ffc0951d..e177d952b 100644 --- a/framework/Cache/lib/Horde/Cache/Eaccelerator.php +++ b/framework/Cache/lib/Horde/Cache/Eaccelerator.php @@ -8,8 +8,9 @@ * 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 Duck - * @package Horde_Cache + * @author Duck + * @category Horde + * @package Cache */ class Horde_Cache_Eaccelerator extends Horde_Cache_Base { diff --git a/framework/Cache/lib/Horde/Cache/File.php b/framework/Cache/lib/Horde/Cache/File.php index 55afadc1a..7da3938e8 100644 --- a/framework/Cache/lib/Horde/Cache/File.php +++ b/framework/Cache/lib/Horde/Cache/File.php @@ -14,9 +14,10 @@ * 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 Anil Madhavapeddy - * @author Chuck Hagenbuch - * @package Horde_Cache + * @author Anil Madhavapeddy + * @author Chuck Hagenbuch + * @category Horde + * @package Cache */ class Horde_Cache_File extends Horde_Cache_Base { diff --git a/framework/Cache/lib/Horde/Cache/Memcache.php b/framework/Cache/lib/Horde/Cache/Memcache.php index 2bf20ae71..ffb9b587a 100644 --- a/framework/Cache/lib/Horde/Cache/Memcache.php +++ b/framework/Cache/lib/Horde/Cache/Memcache.php @@ -3,12 +3,6 @@ * The Horde_Cache_Memcache:: class provides a memcached implementation of the * Horde caching system. * - * Addtional parameters: - * --------------------- - *
- * 'memcache' - (Horde_Memcache) A Horde_Memcache object.
- * 
- * * Copyright 2006-2007 Duck * Copyright 2007-2010 The Horde Project (http://www.horde.org/) * @@ -18,7 +12,7 @@ * @author Duck * @author Michael Slusarz * @category Horde - * @package Horde_Cache + * @package Cache */ class Horde_Cache_Memcache extends Horde_Cache_Base { @@ -38,7 +32,10 @@ class Horde_Cache_Memcache extends Horde_Cache_Base /** * Construct a new Horde_Cache_Memcache object. * - * @param array $params Parameter array. + * @param array $params Parameter array: + *
+     * 'memcache' - (Horde_Memcache) A Horde_Memcache object.
+     * 
* * @throws InvalidArgumentException */ diff --git a/framework/Cache/lib/Horde/Cache/Null.php b/framework/Cache/lib/Horde/Cache/Null.php index 3a05c6b88..06028fe65 100644 --- a/framework/Cache/lib/Horde/Cache/Null.php +++ b/framework/Cache/lib/Horde/Cache/Null.php @@ -8,8 +8,9 @@ * 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 Duck - * @package Horde_Cache + * @author Duck + * @category Horde + * @package Cache */ class Horde_Cache_Null extends Horde_Cache_Base { diff --git a/framework/Cache/lib/Horde/Cache/Sql.php b/framework/Cache/lib/Horde/Cache/Sql.php index 0cf615d6d..38d9fee21 100644 --- a/framework/Cache/lib/Horde/Cache/Sql.php +++ b/framework/Cache/lib/Horde/Cache/Sql.php @@ -3,31 +3,6 @@ * The Horde_Cache_Sql:: class provides a SQL implementation of the Horde * Caching system. * - * Required parameters:
- *   'phptype'      The database type (ie. 'pgsql', 'mysql', etc.).
- * - * Required by some database implementations:
- *   'database'     The name of the database.
- *   'hostspec'     The hostname of the database server.
- *   'username'     The username with which to connect to the database.
- *   'password'     The password associated with 'username'.
- *   'options'      Additional options to pass to the database.
- *   'tty'          The TTY on which to connect to the database.
- *   'port'         The port on which to connect to the database.
- * - * Optional parameters:
- *   'table'             The name of the cache table in 'database'.
- *                       Defaults to 'horde_cache'.
- *   'use_memorycache'   Use this Horde_Cache:: memory caching object to cache
- *                       the data (to avoid DB accesses).
- * - * Optional values when using separate reading and writing servers, for example - * in replication settings:
- *   'splitread'   Boolean, whether to implement the separation or not.
- *   'read'        Array containing the parameters which are different for
- *                 the read database connection, currently supported
- *                 only 'hostspec' and 'port' parameters.
- * * The table structure for the cache is as follows: *
  * CREATE TABLE horde_cache (
@@ -48,9 +23,10 @@
  * 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 
- * @author  Ben Klang 
- * @package Horde_Cache
+ * @author   Michael Slusarz 
+ * @author   Ben Klang 
+ * @category Horde
+ * @package  Cache
  */
 class Horde_Cache_Sql extends Horde_Cache_Base
 {
@@ -86,7 +62,33 @@ class Horde_Cache_Sql extends Horde_Cache_Base
     /**
      * Constructs a new Horde_Cache_Sql object.
      *
-     * @param array $params  A hash containing configuration parameters.
+     * @param array $params  Configuration parameters:
+     * 
+     * Required parameters:
+     * 'phptype' - The database type (ie. 'pgsql', 'mysql', etc.).
+     *
+     * Required by some database implementations:
+     * 'database' - The name of the database.
+     * 'hostspec' - The hostname of the database server.
+     * 'username' - The username with which to connect to the database.
+     * 'password' - The password associated with 'username'.
+     * 'options' - Additional options to pass to the database.
+     * 'tty' - The TTY on which to connect to the database.
+     * 'port' - The port on which to connect to the database.
+     *
+     * Optional parameters:
+     * 'table' - The name of the cache table in 'database'.
+     *           DEFAULT: 'horde_cache'.
+     * 'use_memorycache' -  Use this Horde_Cache memory caching object to
+     *                      cache the data (to avoid DB accesses).
+     *
+     * Optional values when using separate reading and writing servers, for
+     * example in replication settings:
+     * 'splitread' - (boolean) Whether to implement the separation.
+     * 'read' - (array) Parameters which are different for the read database
+     *          connection, currently supported only 'hostspec' and 'port'
+     *          parameters.
+     * 
*/ public function __construct($params = array()) { diff --git a/framework/Cache/lib/Horde/Cache/Xcache.php b/framework/Cache/lib/Horde/Cache/Xcache.php index 861ec11de..cec76ab9e 100644 --- a/framework/Cache/lib/Horde/Cache/Xcache.php +++ b/framework/Cache/lib/Horde/Cache/Xcache.php @@ -8,15 +8,19 @@ * 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 Duck - * @package Horde_Cache + * @author Duck + * @category Horde + * @package Cache */ class Horde_Cache_Xcache extends Horde_Cache_Base { /** * Construct a new Horde_Cache_Xcache object. * - * @param array $params Parameter array. + * @param array $params Configuration parameters: + *
+     * 'prefix' - (string) TODO
+     * 
*/ public function __construct($params = array()) { diff --git a/framework/Cache/lib/Horde/Cache/Zps4.php b/framework/Cache/lib/Horde/Cache/Zps4.php index 11787def9..2e27d4bf1 100644 --- a/framework/Cache/lib/Horde/Cache/Zps4.php +++ b/framework/Cache/lib/Horde/Cache/Zps4.php @@ -8,8 +8,9 @@ * 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 Chuck Hagenbuch - * @package Horde_Cache + * @author Chuck Hagenbuch + * @category Horde + * @package Cache */ class Horde_Cache_Zps4 extends Horde_Cache_Base { diff --git a/framework/Core/lib/Horde/Core/Binder/Cache.php b/framework/Core/lib/Horde/Core/Binder/Cache.php index 4dfaeada8..3b2d34cbe 100644 --- a/framework/Core/lib/Horde/Core/Binder/Cache.php +++ b/framework/Core/lib/Horde/Core/Binder/Cache.php @@ -31,6 +31,10 @@ class Horde_Core_Binder_Cache implements Horde_Injector_Binder } } + if (isset($GLOBALS['conf']['cache']['default_lifetime'])) { + $params['lifetime'] = $GLOBALS['conf']['cache']['default_lifetime']; + } + $params['logger'] = $injector->getInstance('Horde_Log_Logger'); return Horde_Cache::factory($driver, $params);