public function delete() { // Remove as pastas do SRC do controlador FileFolder::removeFolder(MODULES_PATH . ucfirst($this->getModule()) . DS . 'src' . DS . ucfirst($this->getModule()) . DS . 'Models' . DS . strtolower($this->getController())); FileFolder::removeFolder(MODULES_PATH . ucfirst($this->getModule()) . DS . 'src' . DS . ucfirst($this->getModule()) . DS . 'ini' . DS . strtolower($this->getController())); FileFolder::removeFolder(MODULES_PATH . ucfirst($this->getModule()) . DS . 'src' . DS . ucfirst($this->getModule()) . DS . 'translate' . DS . 'pt_BR' . DS . strtolower($this->getController())); // Remove a pasta de VIEW do controlador FileFolder::removeFolder(MODULES_PATH . ucfirst($this->getModule()) . DS . 'view' . DS . strtolower($this->getModule()) . DS . strtolower($this->getController())); // Remove o arquivo principal do controlador @unlink(MODULES_PATH . ucfirst($this->getModule()) . DS . 'src' . DS . ucfirst($this->getModule()) . DS . 'Controller' . DS . ucfirst($this->getController()) . 'Controller.php'); }
public function delete() { if (empty($this->module)) { throw new Exception('Não foi definido o nome do modulo a ser excluido', 500); } else { $libraryFolder = dirname(dirname(dirname(__FILE__))); FileFolder::removeFolder(MODULES_PATH . ucfirst($this->getModule())); FileFolder::removeFolder(PUBLIC_PATH . 'css' . DS . strtolower($this->getModule())); FileFolder::removeFolder(PUBLIC_PATH . 'js' . DS . strtolower($this->getModule())); FileFolder::removeFolder(PUBLIC_PATH . 'img' . DS . strtolower($this->getModule())); @unlink($libraryFolder . DS . 'Mvc' . DS . 'Controller' . DS . 'AbstractActionController' . ucfirst($this->getModule()) . '.php'); } }