本文整理汇总了PHP中VersionCheck::getCurrentCodeVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP VersionCheck::getCurrentCodeVersion方法的具体用法?PHP VersionCheck::getCurrentCodeVersion怎么用?PHP VersionCheck::getCurrentCodeVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VersionCheck
的用法示例。
在下文中一共展示了VersionCheck::getCurrentCodeVersion方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPatch
/**
* 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: display
/**
* 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: display
/**
* Display the form.
*/
function display()
{
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign_by_ref('version', VersionCheck::getCurrentCodeVersion());
parent::display();
}
示例4: checkVersion
/**
* 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: display
/**
* Display the form.
*/
function display()
{
$templateMgr = TemplateManager::getManager($this->_request);
$templateMgr->assign('version', VersionCheck::getCurrentCodeVersion());
parent::display($this->_request);
}
示例6: display
/**
* 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: display
/**
* 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: display
/**
* @copydoc Form::display
*/
function display($request = null, $template = null)
{
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('version', VersionCheck::getCurrentCodeVersion());
parent::display($request, $template);
}