/**
  * execute uninstall.
  *
  * @return bool
  */
 public function executeUninstall()
 {
     $this->_uninstallTables();
     if (!$this->_mForceMode && $this->mLog->hasError()) {
         $this->_processReport();
         return false;
     }
     if ($this->_mXoopsModule->get('mid') != null) {
         $this->_uninstallModule();
         if (!$this->_mForceMode && $this->mLog->hasError()) {
             $this->_processReport();
             return false;
         }
         $this->_uninstallTemplates();
         if (!$this->_mForceMode && $this->mLog->hasError()) {
             $this->_processReport();
             return false;
         }
         $this->_uninstallBlocks();
         if (!$this->_mForceMode && $this->mLog->hasError()) {
             $this->_processReport();
             return false;
         }
         $this->_uninstallPreferences();
         if (!$this->_mForceMode && $this->mLog->hasError()) {
             $this->_processReport();
             return false;
         }
     }
     $this->_processReport();
     return true;
 }
Esempio n. 2
0
 /**
  * @todo Check whether $this->_mXoopsObject is ready.
  */
 function executeInstall()
 {
     $this->_installTables();
     if (!$this->_mForceMode && $this->mLog->hasError()) {
         $this->_processReport();
         return false;
     }
     $this->_installModule();
     if (!$this->_mForceMode && $this->mLog->hasError()) {
         $this->_processReport();
         return false;
     }
     $this->_installTemplates();
     if (!$this->_mForceMode && $this->mLog->hasError()) {
         $this->_processReport();
         return false;
     }
     $this->_installBlocks();
     if (!$this->_mForceMode && $this->mLog->hasError()) {
         $this->_processReport();
         return false;
     }
     $this->_installPreferences();
     if (!$this->_mForceMode && $this->mLog->hasError()) {
         $this->_processReport();
         return false;
     }
     $this->_processScript();
     if (!$this->_mForceMode && $this->mLog->hasError()) {
         $this->_processReport();
         return false;
     }
     $this->_processReport();
     return true;
 }
 /**
  * process report.
  */
 private function _processReport()
 {
     $dirname = $this->_mCurrentXoopsModule->get('dirname');
     $constpref = '_MI_' . strtoupper($dirname);
     if (!$this->mLog->hasError()) {
         $this->mLog->add(XCube_Utils::formatString(constant($constpref . '_INSTALL_MSG_MODULE_UPDATED'), $this->_mCurrentXoopsModule->get('name')));
     } else {
         $this->mLog->add(XCube_Utils::formatString(constant($constpref . '_INSTALL_ERROR_MODULE_UPDATED'), $this->_mCurrentXoopsModule->get('name')));
     }
 }
Esempio n. 4
0
 /**
  * This method executes upgrading automatically by the diff of
  * xoops_version.
  * 
  * 1) Uninstall all of module templates
  * 2) Install all of module templates
  * 
  * @return bool
  */
 function executeAutomaticUpgrade()
 {
     $this->mLog->addReport(_AD_LEGACY_MESSAGE_UPDATE_STARTED);
     //
     // Updates all of module templates
     //
     $this->_updateModuleTemplates();
     if (!$this->_mForceMode && $this->mLog->hasError()) {
         $this->_processReport();
         return false;
     }
     //
     // Update blocks.
     //
     $this->_updateBlocks();
     if (!$this->_mForceMode && $this->mLog->hasError()) {
         $this->_processReport();
         return false;
     }
     //
     // Update preferences & notifications.
     //
     $this->_updatePreferences();
     if (!$this->_mForceMode && $this->mLog->hasError()) {
         $this->_processReport();
         return false;
     }
     //
     // Update module object.
     //
     $this->saveXoopsModule($this->_mTargetXoopsModule);
     if (!$this->_mForceMode && $this->mLog->hasError()) {
         $this->_processReport();
         return false;
     }
     //
     // call back 'onUpdate'
     //
     $this->_processScript();
     if (!$this->_mForceMode && $this->mLog->hasError()) {
         $this->_processReport();
         return false;
     }
     $this->_processReport();
     return true;
 }