phalcon/incubator-config

Phalcon孵化器配置适配器

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

This package is auto-updated.

Last update: 2024-09-19 22:28:38 UTC


README

Discord Packagist Version PHP from Packagist codecov Packagist

XML适配器

读取XML文件并将它们转换为Phalcon\Config对象。

给定以下配置文件

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

您可以这样读取它

use Phalcon\Incubator\Config\Adapter\Xml;

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

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