diff --git a/library/think/Build.php b/library/think/Build.php index 7a531d74c786563c99da034c131eb99f2b703105..10c02effe056df0f03408ef5c4f6712e3530105c 100644 --- a/library/think/Build.php +++ b/library/think/Build.php @@ -91,7 +91,9 @@ class Build foreach ($list as $file) { if (!is_dir($this->basePath . dirname($file))) { // 创建目录 - mkdir($this->basePath . dirname($file), 0755, true); + if (!mkdir($concurrentDirectory = $this->basePath . dirname($file), 0755, true) && !is_dir($concurrentDirectory)) { + throw new Exception(sprintf('Directory "%s" was not created', $concurrentDirectory)); + } } if (!is_file($this->basePath . $file)) { @@ -115,7 +117,9 @@ class Build if (!is_dir($this->basePath . $module)) { // 创建模块目录 - mkdir($this->basePath . $module); + if (!mkdir($concurrentDirectory = $this->basePath . $module) && !is_dir($concurrentDirectory)) { + throw new Exception(sprintf('Directory "%s" was not created', $concurrentDirectory)); + } } if (basename($this->app->getRuntimePath()) != $module) { @@ -409,7 +413,9 @@ class Build protected function checkDirBuild($dirname) { if (!is_dir($dirname)) { - mkdir($dirname, 0755, true); + if (!mkdir($dirname, 0755, true) && !is_dir($dirname)) { + throw new Exception(sprintf('Directory "%s" was not created', $dirname)); + } } } }