Skip to content

Commit

Permalink
运行时目录路径默认识别失败时抛出异常提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurunsoft committed Jan 10, 2020
1 parent 2f35a4a commit c5a1cf7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Util/Imi.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,12 @@ public static function getRuntimePath(...$path)
$parentPath = Config::get('@app.runtimePath');
if(null === $parentPath)
{
$parentPath = File::path(Imi::getNamespacePath(App::getNamespace()), '.runtime');
$namespacePath = Imi::getNamespacePath($namespace = App::getNamespace());
if(null === $namespacePath)
{
throw new \RuntimeException(sprintf('Cannot found path of namespace %s. You can set the config @app.runtimePath.', $namespace));
}
$parentPath = File::path($namespacePath, '.runtime');
}
File::createDir($parentPath);
return File::path($parentPath, ...$path);
Expand Down

0 comments on commit c5a1cf7

Please sign in to comment.