mixed) $options */ public function __construct( array $options = array() ) { $this->properties['host'] = 'localhost'; $this->properties['port'] = 11211; $this->properties['persistent'] = false; $this->properties['compressed'] = false; $this->properties['lockWaitTime'] = 200000; $this->properties['maxLockTime'] = 5; $this->properties['lockKey'] = '.ezcLock'; $this->properties['metaDataKey'] = '.ezcMetaData'; $this->storageOptions = new ezcCacheStorageOptions(); parent::__construct( $options ); } /** * Sets the option $name to $value. * * @throws ezcBasePropertyNotFoundException * If the property $name is not defined. * @throws ezcBaseValueException * If $value is not correct for the property $name. * @param string $name * @param mixed $value * @ignore */ public function __set( $name, $value ) { switch ( $name ) { case 'host': if ( !is_string( $value ) || strlen( $value ) < 1 ) { throw new ezcBaseValueException( $name, $value, 'string, length > 0' ); } break; case 'port': if ( !is_int( $value ) || $value < 1 ) { throw new ezcBaseValueException( $name, $value, 'int > 0' ); } break; case 'persistent': case 'compressed': if ( !is_bool( $value ) ) { throw new ezcBaseValueException( $name, $value, 'bool' ); } break; case 'lockWaitTime': case 'maxLockTime': if ( !is_int( $value ) || $value < 1 ) { throw new ezcBaseValueException( $name, $value, 'int > 0' ); } break; case 'lockKey': case 'metaDataKey': if ( !is_string( $value ) || strlen( $value ) < 1 ) { throw new ezcBaseValueException( $name, $value, 'string, length > 0' ); } break; default: // Delegate $this->storageOptions->$name = $value; } $this->properties[$name] = $value; } /** * Returns the value of the option $name. * * @throws ezcBasePropertyNotFoundException * If the property $name is not defined. * @param string $name The name of the option to get. * @return mixed The option value. * @ignore */ public function __get( $name ) { if ( isset( $this->properties[$name] ) ) { return $this->properties[$name]; } // Delegate return $this->storageOptions->$name; } /** * Returns if option $name is defined. * * @param string $name Option name to check for * @return bool * @ignore */ public function __isset( $name ) { return ( isset( $this->properties[$name] ) || isset( $this->storageOptions->$name ) ); } /** * Merge an ezcCacheStorageOptions object into this object. * * @param ezcCacheStorageOptions $options The options to merge. * @return void * @ignore */ public function mergeStorageOptions( ezcCacheStorageOptions $options ) { $this->storageOptions = $options; } } ?>