phalcon / incubator-config
Phalcon孵化器配置适配器
v2.0.0
2022-02-10 23:06 UTC
Requires
- php: >=7.4
- ext-phalcon: ^5.0.0beta
Requires (Dev)
- codeception/codeception: ^4.1
- codeception/module-asserts: ^1.0.0
- phalcon/ide-stubs: ^4.1
- phpstan/phpstan: ^0.12.18
- squizlabs/php_codesniffer: ^3.5
- vimeo/psalm: ^4.1
Suggests
- ext-simplexml: Need to run in XML Config Adapter
This package is auto-updated.
Last update: 2024-09-19 22:28:38 UTC
README
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;