Asf_Config_Php 读取php配置文件
如果设置ini配置项 asf.cache_config_enable=1, 配置内容会常驻内存
在开启命名空间情况下(asf.use_namespace=1)类名为 Asf\Config\Php
<?php final class Asf_Config_Php extends Asf_Config_AbstractConfig { public function __construct(string $file_path) }
return array(
'host' => '127.0.0.1',
'port' => 6379,
'password' => '123456',
'timeout' => 1,
'persistent' => 0,
'other' => array(
'pass' => '654321'
)
);
<?php
$config = new Asf_Config_Php("/path/conf.php");
var_dump($config->get('host1', 'none'));
var_dump($config->get('host'));
var_dump($config->get('other')->pass);
var_dump($config->host);
print_r($config->other->toArray());