Revert "改名"

This reverts commit fdf58326
This commit is contained in:
2022-01-06 19:05:15 +08:00
parent 45319c3733
commit f867f4be9e
4 changed files with 131 additions and 31 deletions
+13 -3
View File
@@ -9,9 +9,7 @@ declare(strict_types=1);
namespace Kiri\Abstracts;
use Exception;
use Kiri\Exception\ConfigException;
use Kiri\Kiri;
/**
@@ -95,7 +93,19 @@ class Config extends Component
*/
public static function set($key, $value): mixed
{
return static::setData($key, $value);
$explode = explode('.', $key);
$parent = &static::$data;
foreach ($explode as $item) {
if (!isset($parent[$item])) {
$parent[$item] = [];
}
$parent = &$parent[$item];
}
$parent = $value;
unset($parent);
return static::$data;
}
/**