// +---------------------------------------------------------------------- // $Id$ namespace Think; class Create { static public function build($install) { // 锁定 $lockfile = APP_PATH.'install.lock'; if(is_writable($lockfile)) { return ; } else { touch($lockfile); } foreach ($install as $module=>$list){ if(!is_dir(APP_PATH.$module)) {// 创建模块目录 mkdir(APP_PATH.$module); } foreach($list as $path=>$file){ if(is_int($path)) { // 生成文件 if(!is_file(APP_PATH.$module.'/'.$file)) { file_put_contents(APP_PATH.$module.'/'.$file,""); } }else{ if(!is_dir(APP_PATH.$module.'/'.$path)){ mkdir(APP_PATH.$module.'/'.$path); } foreach($file as $val){ switch($path) { case 'Controller': $filename = ucwords($val).$path; if(!is_file(APP_PATH.$module.'/'.$path.'/'.$filename.'.php')) { file_put_contents(APP_PATH.$module.'/'.$path.'/'.$filename.'.php',"