// +---------------------------------------------------------------------- namespace think; class Create { public static function build($build) { // 锁定 $lockfile = APP_PATH . 'create.lock'; if (is_writable($lockfile)) { return; } else { if (!touch($lockfile)) { throw new Exception('目录 [ ' . APP_PATH . ' ] 不可写!'); } } 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, "