Skip to content

Commit 963d380

Browse files
committed
- just release 0.1.0 to be in sync with boilerplate
1 parent 658b56d commit 963d380

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

bootstrap/function.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ function off($value, $property = null, $default = null)
130130
if (is_null($property)) {
131131
return $default;
132132
}
133+
if (!$value) {
134+
return $default;
135+
}
133136

134137
if (is_array($value)) {
135138
return isset($value[$property]) ? $value[$property] : $default;

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
],
1111
"homepage": "https://github.com/phpzm/core",
1212
"license": "MIT",
13-
"version": "0.0.9",
13+
"version": "0.1.0",
1414
"type": "package",
1515
"authors": [
1616
{

src/Kernel/App.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -195,23 +195,23 @@ public static function config($path)
195195
$name = $peaces[0];
196196
array_shift($peaces);
197197

198+
$config = null;
198199
if (isset(self::$CONFIGS[$name])) {
199-
return self::$CONFIGS[$name];
200+
$config = self::$CONFIGS[$name];
200201
}
201-
202-
$config = [];
203-
$filename = path(true, "config/{$name}.php");
204-
if (file_exists($filename)) {
205-
/** @noinspection PhpIncludeInspection */
206-
$config = require $filename;
202+
if (!$config) {
203+
$filename = path(true, "config/{$name}.php");
204+
if (file_exists($filename)) {
205+
/** @noinspection PhpIncludeInspection */
206+
$config = (object) require $filename;
207+
self::$CONFIGS[$name] = $config;
208+
}
207209
}
208-
self::$CONFIGS[$path] = (object)$config;
209-
210-
if (!count($peaces)) {
211-
return self::$CONFIGS[$path];
210+
if (count($peaces) === 0) {
211+
return $config;
212212
}
213213

214-
return search($config, $peaces);
214+
return search((array)$config, $peaces);
215215
}
216216

217217
/**

0 commit comments

Comments
 (0)