예제 #1
0
파일: Skel.plugin.php 프로젝트: davbfr/cf
 public function skel()
 {
     Cli::enableHelp();
     $dir = opendir(getcwd());
     while (false !== ($file = readdir($dir))) {
         if ($file != '.' && $file != '..' && $file != 'data') {
             Cli::question("The current folder is not empty, do you want to continue?");
             break;
         }
     }
     closedir($dir);
     Cli::pinfo("Create new CF project");
     System::copyTree($this->getDir() . DIRECTORY_SEPARATOR . "project", getcwd());
     $this->updateFiles();
     chmod(getcwd() . DIRECTORY_SEPARATOR . "setup", 0755);
     System::ensureDir(DATA_DIR);
     $conf = Config::getInstance();
     $conf->load(CONFIG_DIR . DIRECTORY_SEPARATOR . "config.json");
     foreach ($conf->get("plugins", array()) as $plugin) {
         Plugins::add($plugin);
     }
     Cli::install();
     Options::updateConf(array("DEBUG" => true));
 }