当前位置: 首页>>代码示例>>PHP>>正文


PHP VersionCheck::getPatch方法代码示例

本文整理汇总了PHP中VersionCheck::getPatch方法的典型用法代码示例。如果您正苦于以下问题:PHP VersionCheck::getPatch方法的具体用法?PHP VersionCheck::getPatch怎么用?PHP VersionCheck::getPatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VersionCheck的用法示例。


在下文中一共展示了VersionCheck::getPatch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
 }
开发者ID:ingmarschuster,项目名称:MindResearchRepository,代码行数:54,代码来源:UpgradeTool.inc.php


注:本文中的VersionCheck::getPatch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。