mixed) $options The initial options to set. * @return void * * @throws ezcBasePropertyNotFoundException * If a the value for the property options is not an instance of * @throws ezcBaseValueException * If a the value for a property is out of range. */ public function __construct( array $options = array() ) { $this->properties['barChar'] = "+"; $this->properties['emptyChar'] = "-"; $this->properties['formatString'] = "%act% / %max% [%bar%] %fraction%%"; $this->properties['fractionFormat'] = "%01.2f"; $this->properties['progressChar'] = ">"; $this->properties['redrawFrequency'] = 1; $this->properties['step'] = 1; $this->properties['width'] = 78; $this->properties['actFormat'] = '%.0f'; $this->properties['maxFormat'] = '%.0f'; parent::__construct( $options ); } /** * Option write access. * * @throws ezcBasePropertyNotFoundException * If a desired property could not be found. * @throws ezcBaseSettingValueException * If a desired property value is out of range. * * @param string $key Name of the property. * @param mixed $value The value for the property. * @ignore */ public function __set( $key, $value ) { switch ( $key ) { case "barChar": case "emptyChar": case "progressChar": case "formatString": case "fractionFormat": case "actFormat": case "maxFormat": if ( strlen( $value ) < 1 ) { throw new ezcBaseSettingValueException( $key, $value, 'string, not empty' ); } break; case "width": if ( !is_int( $value ) || $value < 5 ) { throw new ezcBaseSettingValueException( $key, $value, 'int >= 5' ); } break; case "redrawFrequency": case "step": if ( ( !is_int( $value ) && !is_float( $value ) ) || $value < 1 ) { throw new ezcBaseSettingValueException( $key, $value, 'int > 0' ); } break; default: throw new ezcBaseSettingNotFoundException( $key ); } $this->properties[$key] = $value; } } ?>