__construct() public method

Sections are defined as properties of the main object In order to extend another section, a section defines the "_extends" property having a value of the section name from which the extending section inherits values. Note that the keys in $section will override any keys of the same name in the sections that have been included via "_extends". Options may include: - allow_modifications: whether or not the config object is mutable - skip_extends: whether or not to skip processing of parent configuration - yaml_decoder: a callback to use to decode the Yaml source
public __construct ( string $yaml, mixed $section = null, boolean $options = false )
$yaml string YAML file to process
$section mixed Section to process
$options boolean Whether modifiacations are allowed at runtime
Ejemplo n.º 1
0
 /**
  * Loads the section $section from the config file encoded as YAML
  *
  * Sections are defined as properties of the main object
  *
  * In order to extend another section, a section defines the "_extends"
  * property having a value of the section name from which the extending
  * section inherits values.
  *
  * Note that the keys in $section will override any keys of the same
  * name in the sections that have been included via "_extends".
  *
  * Options may include:
  * - allow_modifications: whether or not the config object is mutable
  * - skip_extends: whether or not to skip processing of parent configuration
  * - yaml_decoder: a callback to use to decode the Yaml source
  *
  * @param  string        $yaml     YAML file to process
  * @param  mixed         $section  Section to process
  * @param  array|boolean $options 
  * @param  array|boolean $constants    Local constants
  */
 public function __construct($yaml, $section = null, $options = false)
 {
     //if ($constants)
     //self::setLocalConstants($constants);
     if (is_array($options)) {
         foreach ($options as $key => $value) {
             switch (strtolower($key)) {
                 case 'constants':
                     $this->setLocalConstants($value);
                     break;
                 default:
                     break;
             }
         }
     }
     parent::__construct($yaml, $section, $options);
 }