本文整理汇总了PHP中VersionCheck::getLatestVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP VersionCheck::getLatestVersion方法的具体用法?PHP VersionCheck::getLatestVersion怎么用?PHP VersionCheck::getLatestVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VersionCheck
的用法示例。
在下文中一共展示了VersionCheck::getLatestVersion方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: systemInfo
/**
* Show system information summary.
* @param $args array
* @param $request PKPRequest
*/
function systemInfo($args, $request)
{
$this->setupTemplate($request, true);
$versionDao = DAORegistry::getDAO('VersionDAO');
$currentVersion = $versionDao->getCurrentVersion();
$templateMgr = TemplateManager::getManager($request);
$templateMgr->assign('currentVersion', $currentVersion);
if ($request->getUserVar('versionCheck')) {
$latestVersionInfo = VersionCheck::getLatestVersion();
$latestVersionInfo['patch'] = VersionCheck::getPatch($latestVersionInfo);
$templateMgr->assign('latestVersionInfo', $latestVersionInfo);
}
$templateMgr->display('admin/systemInfo.tpl');
}
示例2: systemInfo
/**
* Show system information summary.
*/
function systemInfo()
{
$this->validate();
$this->setupTemplate(true);
$configData =& Config::getData();
$dbconn =& DBConnection::getConn();
$dbServerInfo = $dbconn->ServerInfo();
$versionDao =& DAORegistry::getDAO('VersionDAO');
$currentVersion =& $versionDao->getCurrentVersion();
$versionHistory =& $versionDao->getVersionHistory();
$serverInfo = array('admin.server.platform' => Core::serverPHPOS(), 'admin.server.phpVersion' => Core::serverPHPVersion(), 'admin.server.apacheVersion' => function_exists('apache_get_version') ? apache_get_version() : Locale::translate('common.notAvailable'), 'admin.server.dbDriver' => Config::getVar('database', 'driver'), 'admin.server.dbVersion' => empty($dbServerInfo['description']) ? $dbServerInfo['version'] : $dbServerInfo['description']);
$templateMgr =& TemplateManager::getManager();
$templateMgr->assign_by_ref('currentVersion', $currentVersion);
$templateMgr->assign_by_ref('versionHistory', $versionHistory);
$templateMgr->assign_by_ref('configData', $configData);
$templateMgr->assign_by_ref('serverInfo', $serverInfo);
if (Request::getUserVar('versionCheck')) {
$latestVersionInfo =& VersionCheck::getLatestVersion();
$latestVersionInfo['patch'] = VersionCheck::getPatch($latestVersionInfo);
$templateMgr->assign_by_ref('latestVersionInfo', $latestVersionInfo);
}
$templateMgr->display('admin/systemInfo.tpl');
}
示例3: download
/**
* Download latest package/patch.
*/
function download()
{
$versionInfo = VersionCheck::getLatestVersion();
if (!$versionInfo) {
$application =& PKPApplication::getApplication();
printf("Failed to load version info from %s\n", $application->getVersionDescriptorUrl());
exit(1);
}
$type = isset($this->argv[1]) && $this->argv[1] == 'patch' ? 'patch' : 'package';
if ($type == 'package') {
$download = $versionInfo['package'];
} else {
$download = VersionCheck::getPatch($versionInfo);
}
if (!isset($download)) {
printf("No applicable download available\n");
return;
}
$outFile = basename($download);
printf("Download %s: %s\n", $type, $download);
printf("File will be saved to: %s\n", $outFile);
if (!$this->promptContinue()) {
exit(0);
}
$out = fopen($outFile, 'wb');
if (!$out) {
printf("Failed to open %s for writing\n", $outFile);
exit(1);
}
$in = fopen($download, 'rb');
if (!$in) {
printf("Failed to open %s for reading\n", $download);
fclose($out);
exit(1);
}
printf('Downloading file...');
while (($data = fread($in, 4096)) !== '') {
printf('.');
fwrite($out, $data);
}
printf("done\n");
fclose($in);
fclose($out);
}
示例4: checkIfNewVersionExists
/**
* Checks the application's version against the latest version
* on the PKP servers.
* @return string or false if no newer version
*/
function checkIfNewVersionExists()
{
$versionInfo =& VersionCheck::getLatestVersion();
$latestVersion = $versionInfo['release'];
$currentVersion =& VersionCheck::getCurrentDBVersion();
if ($currentVersion->compare($latestVersion) < 0) {
return $latestVersion;
} else {
return false;
}
}
示例5: download
/**
* Download latest package.
*/
function download()
{
$versionInfo = VersionCheck::getLatestVersion();
if (!$versionInfo) {
$application = PKPApplication::getApplication();
printf("Failed to load version info from %s\n", $application->getVersionDescriptorUrl());
exit(1);
}
$download = $versionInfo['package'];
$outFile = basename($download);
printf("Download %s: %s\n", $type, $download);
printf("File will be saved to: %s\n", $outFile);
if (!$this->promptContinue()) {
exit(0);
}
$out = fopen($outFile, 'wb');
if (!$out) {
printf("Failed to open %s for writing\n", $outFile);
exit(1);
}
$in = fopen($download, 'rb');
if (!$in) {
printf("Failed to open %s for reading\n", $download);
fclose($out);
exit(1);
}
printf('Downloading file...');
while (($data = fread($in, 4096)) !== '') {
printf('.');
fwrite($out, $data);
}
printf("done\n");
fclose($in);
fclose($out);
}