function removeTestTemplateFiles() { FileSystemTools::rmdirRecursive($this->ROOT_PATH . "/system/modules/systestmodule"); FileSystemTools::rmdirRecursive($this->ROOT_PATH . "/modules/testmodule"); foreach (['templates/testmodule/testtemplate', 'templates/testmodule/get', 'templates/testmodule/edit', 'templates/testmodule/submodule', 'templates/testmodule/testmodule', 'templates/testtemplate', 'templates/get', 'templates/edit', 'templates/submodule', 'templates/testmodule', 'system/templates/testtemplate', 'system/templates/get', 'system/templates/edit', 'system/templates/submodule', 'system/templates/testmodule'] as $toRemove) { if (file_exists($this->ROOT_PATH . DIRECTORY_SEPARATOR . $toRemove . '.tpl.php')) { unlink($this->ROOT_PATH . DIRECTORY_SEPARATOR . $toRemove . '.tpl.php'); } } if (file_exists($this->ROOT_PATH . "/templates/minilayout.tpl.php")) { unlink($this->ROOT_PATH . "/templates/minilayout.tpl.php"); } }
protected function _after() { FileSystemTools::rmdirRecursive($this->tmpPath1); FileSystemTools::rmdirRecursive($this->tmpPath2); }
static function prune($dir) { // echo "PRUNE ".$dir."\n"; if (is_dir($dir)) { // echo "PRUNE IS DIR ".$dir."\n"; foreach (glob($dir . '/*') as $file) { // echo "PRUNE INNER ".$file."\n"; if (is_dir($dir . DS . basename($file))) { // echo "PRUNE ISDIR ".$dir.DS.basename($file)."\n"; FileSystemTools::rmdirRecursive($dir . DS . basename($file)); } else { //echo "PRUNE IS FILE".$dir.DS.basename($file)."\n"; unlink($dir . DS . basename($file)); } } } }