当前位置: 首页>>代码示例>>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;未经允许,请勿转载。