/** * Deletes all extension folders and the app/etc/modules config file. */ public function deleteExtensionFolderFiles() { $namespacePath = $this->_getNamespacePath(); $extensionPath = $this->_getExtensionPath(); try { $this->_filesystem->rmdir($extensionPath, true); if (is_dir($namespacePath)) { $this->_filesystem->cd($namespacePath); if (count($this->_filesystem->ls()) == 0) { $this->_filesystem->rmdir($namespacePath, true); } } $modulesConfigFile = $this->_namespace . '_' . $this->_extensionName . '.xml'; $modulesConfigFilePath = $this->_helper->getModulesConfigDir() . DS . $modulesConfigFile; if (file_exists($modulesConfigFilePath)) { $this->_filesystem->rm($modulesConfigFilePath); } } catch (Exception $e) { Mage::log($e->getMessage(), null, $this->_helper->getLogFilename()); Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); } }
/** * Gets the source file path given the filename. * * @param $filename * @return string */ protected function getSourceFilesPath($filename) { return $this->_helper->getSourceFilesDir() . DS . $filename; }