feat: 同步下新环境

This commit is contained in:
笔记本里的永平
2025-07-07 11:31:25 +08:00
parent 3d1050db3d
commit 86c261ba70
196 changed files with 13146 additions and 29319 deletions

View File

@@ -13,19 +13,12 @@ namespace think\config\driver;
class Ini
{
protected $config;
public function __construct($config)
public function parse($config)
{
$this->config = $config;
}
public function parse()
{
if (is_file($this->config)) {
return parse_ini_file($this->config, true);
if (is_file($config)) {
return parse_ini_file($config, true);
} else {
return parse_ini_string($this->config, true);
return parse_ini_string($config, true);
}
}
}

View File

@@ -13,19 +13,12 @@ namespace think\config\driver;
class Json
{
protected $config;
public function __construct($config)
public function parse($config)
{
if (is_file($config)) {
$config = file_get_contents($config);
}
$this->config = $config;
}
public function parse()
{
return json_decode($this->config, true);
$result = json_decode($config, true);
return $result;
}
}

View File

@@ -13,28 +13,19 @@ namespace think\config\driver;
class Xml
{
protected $config;
public function __construct($config)
public function parse($config)
{
$this->config = $config;
}
public function parse()
{
if (is_file($this->config)) {
$content = simplexml_load_file($this->config);
if (is_file($config)) {
$content = simplexml_load_file($config);
} else {
$content = simplexml_load_string($this->config);
$content = simplexml_load_string($config);
}
$result = (array) $content;
foreach ($result as $key => $val) {
if (is_object($val)) {
$result[$key] = (array) $val;
}
}
return $result;
}
}