コード例 #1
0
ファイル: VersionCheck.inc.php プロジェクト: alenoosh/ojs
 /**
  * Find the applicable patch for the current code version (if available).
  * @param $versionInfo array as returned by parseVersionXML()
  * @param $codeVersion as returned by getCurrentCodeVersion()
  * @return string
  */
 function getPatch(&$versionInfo, $codeVersion = null)
 {
     if (!isset($codeVersion)) {
         $codeVersion =& VersionCheck::getCurrentCodeVersion();
     }
     if (isset($versionInfo['patch'][$codeVersion->getVersionString()])) {
         return $versionInfo['patch'][$codeVersion->getVersionString()];
     }
     return null;
 }
コード例 #2
0
ファイル: InstallForm.inc.php プロジェクト: alenoosh/ojs
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('localeOptions', $this->supportedLocales);
     $templateMgr->assign('clientCharsetOptions', $this->supportedClientCharsets);
     $templateMgr->assign('connectionCharsetOptions', $this->supportedConnectionCharsets);
     $templateMgr->assign('databaseCharsetOptions', $this->supportedDatabaseCharsets);
     $templateMgr->assign('encryptionOptions', $this->supportedEncryptionAlgorithms);
     $templateMgr->assign('databaseDriverOptions', $this->checkDBDrivers());
     $templateMgr->assign('supportsMBString', String::hasMBString() ? Locale::translate('common.yes') : Locale::translate('common.no'));
     $templateMgr->assign('phpIsSupportedVersion', version_compare(PHP_REQUIRED_VERSION, PHP_VERSION) != 1);
     $templateMgr->assign('phpRequiredVersion', PHP_REQUIRED_VERSION);
     $templateMgr->assign('phpVersion', PHP_VERSION);
     $templateMgr->assign('version', VersionCheck::getCurrentCodeVersion());
     parent::display();
 }
コード例 #3
0
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign_by_ref('version', VersionCheck::getCurrentCodeVersion());
     parent::display();
 }
コード例 #4
0
 /**
  * Perform version check.
  * @param $versionInfo array latest version info
  * @param $displayInfo boolean just display info, don't perform check
  */
 function checkVersion($versionInfo, $displayInfo = false)
 {
     if (!$versionInfo) {
         $application =& PKPApplication::getApplication();
         printf("Failed to load version info from %s\n", $application->getVersionDescriptorUrl());
         exit(1);
     }
     $dbVersion = VersionCheck::getCurrentDBVersion();
     $codeVersion = VersionCheck::getCurrentCodeVersion();
     $latestVersion = $versionInfo['version'];
     printf("Code version:      %s\n", $codeVersion->getVersionString());
     printf("Database version:  %s\n", $dbVersion->getVersionString());
     printf("Latest version:    %s\n", $latestVersion->getVersionString());
     $compare1 = $codeVersion->compare($latestVersion);
     $compare2 = $dbVersion->compare($codeVersion);
     if (!$displayInfo) {
         if ($compare2 < 0) {
             printf("Database version is older than code version\n");
             printf("Run \"{$this->scriptName} upgrade\" to update\n");
             exit(0);
         } else {
             if ($compare2 > 0) {
                 printf("Database version is newer than code version!\n");
                 exit(1);
             } else {
                 if ($compare1 == 0) {
                     printf("Your system is up-to-date\n");
                 } else {
                     if ($compare1 < 0) {
                         printf("A newer version is available:\n");
                         $displayInfo = true;
                     } else {
                         printf("Current version is newer than latest!\n");
                         exit(1);
                     }
                 }
             }
         }
     }
     if ($displayInfo) {
         $patch = VersionCheck::getPatch($versionInfo, $codeVersion);
         printf("         tag:     %s\n", $versionInfo['tag']);
         printf("         date:    %s\n", $versionInfo['date']);
         printf("         info:    %s\n", $versionInfo['info']);
         printf("         package: %s\n", $versionInfo['package']);
         printf("         patch:   %s\n", isset($patch) ? $patch : 'N/A');
     }
     return $compare1;
 }
コード例 #5
0
ファイル: MaintenanceForm.inc.php プロジェクト: jprk/pkp-lib
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr = TemplateManager::getManager($this->_request);
     $templateMgr->assign('version', VersionCheck::getCurrentCodeVersion());
     parent::display($this->_request);
 }
コード例 #6
0
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('localeOptions', $this->supportedLocales);
     $templateMgr->assign('localesComplete', $this->localesComplete);
     $templateMgr->assign('clientCharsetOptions', $this->supportedClientCharsets);
     $templateMgr->assign('connectionCharsetOptions', $this->supportedConnectionCharsets);
     $templateMgr->assign('databaseCharsetOptions', $this->supportedDatabaseCharsets);
     $templateMgr->assign('encryptionOptions', $this->supportedEncryptionAlgorithms);
     $templateMgr->assign('allowFileUploads', get_cfg_var('file_uploads') ? __('common.yes') : __('common.no'));
     $templateMgr->assign('maxFileUploadSize', get_cfg_var('upload_max_filesize'));
     $templateMgr->assign('databaseDriverOptions', $this->checkDBDrivers());
     $templateMgr->assign('supportsMBString', String::hasMBString() ? __('common.yes') : __('common.no'));
     $templateMgr->assign('phpIsSupportedVersion', version_compare(PHP_REQUIRED_VERSION, PHP_VERSION) != 1);
     $templateMgr->assign('phpRequiredVersion', PHP_REQUIRED_VERSION);
     $templateMgr->assign('phpVersion', PHP_VERSION);
     $templateMgr->assign('version', VersionCheck::getCurrentCodeVersion());
     $templateMgr->assign('passwordLength', INSTALLER_DEFAULT_MIN_PASSWORD_LENGTH);
     parent::display();
 }
コード例 #7
0
ファイル: InstallForm.inc.php プロジェクト: utlib/ojs
 /**
  * Display the form.
  */
 function display()
 {
     $templateMgr = TemplateManager::getManager($this->_request);
     $templateMgr->assign('localeOptions', $this->supportedLocales);
     $templateMgr->assign('localesComplete', $this->localesComplete);
     $templateMgr->assign('clientCharsetOptions', $this->supportedClientCharsets);
     $templateMgr->assign('connectionCharsetOptions', $this->supportedConnectionCharsets);
     $templateMgr->assign('databaseCharsetOptions', $this->supportedDatabaseCharsets);
     $templateMgr->assign('encryptionOptions', $this->supportedEncryptionAlgorithms);
     $templateMgr->assign('allowFileUploads', get_cfg_var('file_uploads') ? __('common.yes') : __('common.no'));
     $templateMgr->assign('maxFileUploadSize', get_cfg_var('upload_max_filesize'));
     $templateMgr->assign('databaseDriverOptions', $this->checkDBDrivers());
     $templateMgr->assign('supportsMBString', String::hasMBString() ? __('common.yes') : __('common.no'));
     $templateMgr->assign('phpIsSupportedVersion', version_compare(PHP_REQUIRED_VERSION, PHP_VERSION) != 1);
     $templateMgr->assign('xslEnabled', Core::checkGeneralPHPModule('xsl'));
     $templateMgr->assign('xslRequired', false);
     $templateMgr->assign('phpRequiredVersion', PHP_REQUIRED_VERSION);
     $templateMgr->assign('phpVersion', PHP_VERSION);
     $templateMgr->assign('version', VersionCheck::getCurrentCodeVersion());
     parent::display();
 }
コード例 #8
0
ファイル: MaintenanceForm.inc.php プロジェクト: pkp/pkp-lib
 /**
  * @copydoc Form::display
  */
 function display($request = null, $template = null)
 {
     $templateMgr = TemplateManager::getManager($request);
     $templateMgr->assign('version', VersionCheck::getCurrentCodeVersion());
     parent::display($request, $template);
 }