示例#1
0
 private function addSomeVariablesToSection(\ConfigVariable $variable, $amount = 0, $mutable = false)
 {
     for ($i = 0; $i < $amount; $i++) {
         if ($mutable) {
             $name = $variable->getVariable() . '_' . $i;
             $variable = new \ConfigVariable($name, $variable->getValue(), $variable->getComment());
         }
         $this->object->addVariable($variable);
     }
 }
示例#2
0
 /**
  * Converts raw ini config into it's object representation
  * 
  * @param array $raw_config Raw config
  * @param array $options Options
  * @return \ConfigContainer Config object
  */
 public function objectify(array $raw_config = array(), array $options = array())
 {
     $config = new ConfigContainer();
     foreach ($raw_config as $section_name => $section_variables) {
         $section = new ConfigSection($section_name);
         foreach ($section_variables as $variable_name => $variable_value) {
             $section->addVariable(new ConfigVariable($variable_name, $variable_value));
         }
         $config->addSection($section);
     }
     return $config;
 }