コード例 #1
1
ファイル: UpgradeForm.inc.php プロジェクト: jprk/pkp-lib
 /**
  * Perform installation.
  */
 function execute()
 {
     define('RUNNING_UPGRADE', 1);
     $templateMgr = TemplateManager::getManager($this->_request);
     $installer = new Upgrade($this->_data);
     // FIXME Use logger?
     // FIXME Mostly common with InstallForm
     if ($installer->execute()) {
         if (!$installer->wroteConfig()) {
             // Display config file contents for manual replacement
             $templateMgr->assign(array('writeConfigFailed' => true, 'configFileContents' => $installer->getConfigContents()));
         }
         $templateMgr->assign('notes', $installer->getNotes());
         $templateMgr->assign('newVersion', $installer->getNewVersion());
         $templateMgr->display('install/upgradeComplete.tpl');
     } else {
         switch ($installer->getErrorType()) {
             case INSTALLER_ERROR_DB:
                 $this->dbInstallError($installer->getErrorMsg());
                 break;
             default:
                 $this->installError($installer->getErrorMsg());
                 break;
         }
     }
     $installer->destroy();
 }