feat: 本次提交更新内容如下
php有问题,覆盖下
This commit is contained in:
@@ -13,19 +13,28 @@ namespace think\config\driver;
|
||||
|
||||
class Xml
|
||||
{
|
||||
public function parse($config)
|
||||
protected $config;
|
||||
|
||||
public function __construct($config)
|
||||
{
|
||||
if (is_file($config)) {
|
||||
$content = simplexml_load_file($config);
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
public function parse()
|
||||
{
|
||||
if (is_file($this->config)) {
|
||||
$content = simplexml_load_file($this->config);
|
||||
} else {
|
||||
$content = simplexml_load_string($config);
|
||||
$content = simplexml_load_string($this->config);
|
||||
}
|
||||
|
||||
$result = (array) $content;
|
||||
foreach ($result as $key => $val) {
|
||||
if (is_object($val)) {
|
||||
$result[$key] = (array) $val;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user