Reads xml files and converts them to Phalcon\Config objects. Given the next configuration file: /phalcon/ memory here You can read it as follows: use Phalcon\Config\Adapter\Xml; $config = new Xml("path/config.xml"); echo $config->phalcon->baseuri; echo $config->nested->config->parameter;
Inheritance: extends Phalcon\Config
Example #1
0
 /**
  * Tests toArray method
  *
  * @author Serghei Iakovlev <*****@*****.**>
  * @since  2016-03-04
  */
 public function testConfigToArray()
 {
     $this->specify("Transform Config to the array does not returns the expected result", function () {
         $expected = ['phalcon' => ['baseuri' => '/phalcon/'], 'models' => ['metadata' => 'memory'], 'nested' => ['config' => ['parameter' => 'here']]];
         $config = new Xml(PATH_DATA . 'config/config.xml');
         expect($config->toArray())->equals($expected);
     });
 }