Author: Tobias Schlitt
Date: 2006-01-13 10:24:34 +0100 (Fri, 13 Jan 2006)
New Revision: 1812
Log:
- Fixed todo: Implemented value checks for ezcCacheStorage options.
Modified:
packages/Cache/trunk/src/storage.php
Modified: packages/Cache/trunk/src/storage.php
===================================================================
--- packages/Cache/trunk/src/storage.php 2006-01-13 09:19:33 UTC (rev
1811)
+++ packages/Cache/trunk/src/storage.php 2006-01-13 09:24:34 UTC (rev
1812)
@@ -200,7 +200,6 @@
*
* @throws ezcBaseSettingNotFoundException
* If the desired option does not exist.
- * @todo Sanity checks for options.
*/
public function setOptions( $options = null )
{
@@ -212,6 +211,21 @@
{
if ( isset( $this->options[$name] ) )
{
+ switch ( $name )
+ {
+ case 'ttl':
+ if ( !is_int( $val ) || $val < 0 )
+ {
+ throw new ezcBaseSettingValueException( $name,
$val, 'Integer larger or equal to 0.');
+ }
+ break;
+ case 'extension':
+ if ( !is_string( $val ) )
+ {
+ throw new ezcBaseSettingValueException( $name,
$val, 'String.');
+ }
+ break;
+ }
$this->options[$name] = $val;
}
else
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components