3 * File containing the ezcBaseAutoloadOptions class
7 * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
8 * @license http://ez.no/licenses/new_bsd New BSD License
12 * Class containing the basic options for ezcBase' autoload.
14 * @property bool $preload
15 * If component preloading is enabled then as soon as one of the
16 * classes of a component is request, all other classes in the
17 * component are loaded as well (except for Exception classes).
18 * @property bool $debug
19 * If debug is enabled then the autoload method will show exceptions
20 * when a class can not be found. Because exceptions are ignored by
21 * PHP in the autoload handler, you have to catch them in autoload()
22 * yourself and do something with the exception message.
27 class ezcBaseAutoloadOptions
extends ezcBaseOptions
30 * Constructs an object with the specified values.
32 * @throws ezcBasePropertyNotFoundException
33 * if $options contains a property not defined
34 * @throws ezcBaseValueException
35 * if $options contains a property with a value not allowed
36 * @param array(string=>mixed) $options
38 public function __construct( array $options = array() )
40 $this->preload
= false;
43 parent
::__construct( $options );
47 * Sets the option $name to $value.
49 * @throws ezcBasePropertyNotFoundException
50 * if the property $name is not defined
51 * @throws ezcBaseValueException
52 * if $value is not correct for the property $name
57 public function __set( $name, $value )
63 if ( !is_bool( $value ) )
65 throw new ezcBaseValueException( $name, $value, 'bool' );
67 $this->properties
[$name] = $value;
71 throw new ezcBasePropertyNotFoundException( $name );