From 24755c4cf62b9cf7029fed9cc4bb144e25ed2f57 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 7 Apr 2013 15:08:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BThink\Create=E7=B1=BB?= =?UTF-8?q?=EF=BC=8C=E6=94=AF=E6=8C=81=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=9A=84=E5=85=AC=E5=85=B1=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Think/Create.php | 46 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/Think/Create.php b/Think/Create.php index 0065fe80..0ba33a4f 100644 --- a/Think/Create.php +++ b/Think/Create.php @@ -12,43 +12,50 @@ namespace Think; class Create { - static public function build($install) { + static public function build($build) { // 锁定 - $lockfile = APP_PATH.'install.lock'; + $lockfile = APP_PATH.'create.lock'; if(is_writable($lockfile)) { return ; } else { touch($lockfile); } - foreach ($install as $module=>$list){ + foreach ($build as $module=>$list){ if(!is_dir(APP_PATH.$module)) {// 创建模块目录 mkdir(APP_PATH.$module); } + // 创建配置文件和公共文件 + self::buildCommonFile($module); + // 创建欢迎页面 + self::buildHelloController($module); + + // 创建子目录和文件 foreach($list as $path=>$file){ if(is_int($path)) { // 生成文件 if(!is_file(APP_PATH.$module.'/'.$file)) { - file_put_contents(APP_PATH.$module.'/'.$file,""); + file_put_contents(APP_PATH.$module.'/'.$file,"