phalcon/incubator-config

Phalcon Incubator Config Adapters

v2.0.0 2022-02-10 23:06 UTC

This package is auto-updated.

Last update: 2024-11-19 22:50:28 UTC


README

Discord Packagist Version PHP from Packagist codecov Packagist

XML Adapter

Reads xml files and converts them to Phalcon\Config objects.

Given the next configuration file:

<root>
  <phalcon>
    <baseuri>/phalcon/</baseuri>
  </phalcon>
  <models>
    <metadata>memory</metadata>
  </models>
  <nested>
    <config>
      <parameter>here</parameter>
    </config>
  </nested>
</root>

You can read it as follows:

use Phalcon\Incubator\Config\Adapter\Xml;

$config = new Xml('path/config.xml');

echo $config->phalcon->baseuri;
echo $config->nested->config->parameter;