protected function readOptions($args) { if (in_array("--overwrite", $args, true)) { $index = array_search("--overwrite", $args) + 1; for ($i = $index, $c = count($args); $i < $c; $i++) { if (substr($args[$i], 0, 2) === "--") { break; } $path = $this->targetDir . DS . $args[$i]; if (is_file($path)) { unlink($path); } elseif (is_dir($path)) { $fs = new Sabel_Util_FileSystem($path); $fs->rmdir(); } } } if (in_array("--ignore", $args, true)) { $index = array_search("--ignore", $args) + 1; for ($i = $index, $c = count($args); $i < $c; $i++) { if (substr($args[$i], 0, 2) === "--") { break; } $this->ignore[$args[$i]] = 1; } } if (Sabel_Console::hasOption("l", $args)) { if (($lang = Sabel_Console::getOption("l", $args)) !== null) { $lang = strtolower($lang); if (is_dir($this->skeletonDir . DS . $lang)) { $this->lang = $lang; } } } }
public function testCleanup() { $fs = new Sabel_Util_FileSystem($this->basedir); $fs->rmdir("test"); $fs->rmdir("moved"); }