コード例 #1
0
 public function uninstallModule($moduleRefName)
 {
     global $installers, $moduleIDs, $moduleTypes;
     global $options;
     $return = true;
     $module = strtolower($moduleRefName);
     $moduleCode = $this->getModuleCode($module);
     $msg = "Uninstalling Module '" . $moduleCode . "'...";
     $newModule = new ModuleModel($this->db);
     if ($newModule->loadCode($moduleCode)) {
         //            $this->_addTraceInfo(__FILE__, __METHOD__, __LINE__, $msg, self::TRACE_TYPE_DEBUG);
         //            $this->_logVerbose($msg);
         //---- Determine Module Type
         $filePath = 'modules/' . $moduleCode . '/';
         if ($moduleTypes[$newModule->id] == MODULE_TYPE_CUSTOM) {
             $filePath = APP_PATH . $filePath;
         } else {
             $filePath = PHPANVIL2_FRAMEWORK_PATH . $filePath;
         }
         if (file_exists($filePath)) {
             $filePath .= $moduleCode . '.install.php';
             //                FB::log($filePath);
             include_once $filePath;
             $installers[$moduleCode]->uninstall($newModule);
         } else {
             $msg = 'Module (' . $moduleCode . ') does not exist.';
             //                $this->_addTraceInfo(__FILE__, __METHOD__, __LINE__, $msg, self::TRACE_TYPE_ERROR);
             $return = false;
         }
     } else {
         $msg = 'Module (' . $moduleCode . ') is not installed.';
         $return = false;
     }
     //        FB::log($msg);
     $this->_logVerbose($msg);
     return $return;
 }