/** * removes a cloned repo * * */ public function removeClone() { $dir = $this->Directory(); GeneralMethods::output_to_screen('Removing ' . $dir . ' and all its contents ... ', "created"); $this->gitRepo = null; FileSystem::removeFolder($dir); // removes contents but not the actual folder //rmdir ($dir); return !file_exists($dir); }
/** * Delete related environments and folders */ public function onAfterDelete() { parent::onAfterDelete(); // Delete related environments foreach ($this->Environments() as $env) { $env->delete(); } if (!file_exists($this->getProjectFolderPath())) { return; } // Create a basic new environment config from a template if (Config::inst()->get('DNEnvironment', 'allow_web_editing')) { FileSystem::removeFolder($this->getProjectFolderPath()); } }
public static function removeDirectory($path) { FileSystem::removeFolder($path); }