public static function uninstall() { $locations = self::_getPluginLocations(); if ($modules = self::_getModulesFromXml($locations['xmlPath'])) { foreach ($modules as $m) { $modDataArr = utilsGmp::xmlNodeAttrsToArr($m); self::_uninstallTables($modDataArr); frameGmp::_()->getModule('options')->getModel('modules')->delete(array('code' => $modDataArr['code'])); utilsGmp::deleteDir(GMP_MODULES_DIR . $modDataArr['code']); } } }
public static function deleteDir($str) { if (is_file($str)) { return self::deleteFile($str); } elseif (is_dir($str)) { $scan = glob(rtrim($str, '/') . '/*'); foreach ($scan as $index => $path) { utilsGmp::deleteDir($path); } return @rmdir($str); } }