From 9832351fad60c46d624a67411d9bb5176b8c24b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=9F=E5=93=B2=E7=A7=91=E6=8A=80?= Date: Wed, 12 Jan 2022 03:09:33 +0000 Subject: [PATCH] =?UTF-8?q?update=20library/think/Build.php.=20=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=A8=A1=E5=9D=97=E6=96=87=E4=BB=B6=E6=97=B6=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=98=AF=E5=90=A6=E7=94=9F=E6=88=90=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Build.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/library/think/Build.php b/library/think/Build.php index 7a531d74..10c02eff 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)); + } } } } -- Gitee