當前位置: 首頁>>代碼示例>>PHP>>正文


PHP VersionCheck::getLatestVersion方法代碼示例

本文整理匯總了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');
 }
開發者ID:jprk,項目名稱:pkp-lib,代碼行數:19,代碼來源:AdminFunctionsHandler.inc.php

示例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');
 }
開發者ID:ramonsodoma,項目名稱:harvester,代碼行數:26,代碼來源:AdminFunctionsHandler.inc.php

示例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);
 }
開發者ID:ingmarschuster,項目名稱:MindResearchRepository,代碼行數:47,代碼來源:UpgradeTool.inc.php

示例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;
     }
 }
開發者ID:farhanabbas1983,項目名稱:ojs-1,代碼行數:16,代碼來源:VersionCheck.inc.php

示例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);
 }
開發者ID:jalperin,項目名稱:pkp-lib,代碼行數:38,代碼來源:UpgradeTool.inc.php


注:本文中的VersionCheck::getLatestVersion方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。