cvs: pear /Cache_Lite Cache_Lite.php
| From: | Fabien MARTY | Date: | Thu, 08 Aug 2002 20:28:19 +0000 |
| Subject: | cvs: pear /Cache_Lite Cache_Lite.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5642@lists.php.net to get a copy of this message | ||
fab Thu Aug 8 16:28:19 2002 EDT
Modified files:
/pear/Cache_Lite Cache_Lite.php
Log:
Add a test of available options in constructor
Index: pear/Cache_Lite/Cache_Lite.php
diff -u pear/Cache_Lite/Cache_Lite.php:1.5 pear/Cache_Lite/Cache_Lite.php:1.6
--- pear/Cache_Lite/Cache_Lite.php:1.5 Mon Aug 5 17:35:47 2002
+++ pear/Cache_Lite/Cache_Lite.php Thu Aug 8 16:28:19 2002
@@ -10,7 +10,7 @@
* There are some examples in the 'docs/examples' file
* Technical choices are described in the 'docs/technical' file
*
-* @version $Id: Cache_Lite.php,v 1.5 2002/08/05 21:35:47 fab Exp $
+* @version $Id: Cache_Lite.php,v 1.6 2002/08/08 20:28:19 fab Exp $
* @author Fabien MARTY <fab@php.net>
*/
@@ -127,7 +127,7 @@
/**
* Constructor
*
- * $options is an assoc. Availables options are :
+ * $options is an assoc. Available options are :
* $options = array(
* 'cacheDir' => directory where to put the cache files (string),
* 'caching' => enable / disable caching (boolean),
@@ -144,9 +144,12 @@
*/
function Cache_Lite($options = NULL)
{
+ $availableOptions =
'{cacheDir}{caching}{lifeTime}{fileLocking}{writeControl}{readControl}{readControlType}{pearErrorMode}';
while (list($key, $value) = each($options)) {
- $property = '_'.$key;
- $this->$property = $value;
+ if (strpos('>'.$availableOptions, '{'.$key.'}')) {
+ $property = '_'.$key;
+ $this->$property = $value;
+ }
}
$this->_refreshTime = time() - $this->_lifeTime;
}