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


PHP VersionCheck::getCurrentDBVersion方法代碼示例

本文整理匯總了PHP中VersionCheck::getCurrentDBVersion方法的典型用法代碼示例。如果您正苦於以下問題:PHP VersionCheck::getCurrentDBVersion方法的具體用法?PHP VersionCheck::getCurrentDBVersion怎麽用?PHP VersionCheck::getCurrentDBVersion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在VersionCheck的用法示例。


在下文中一共展示了VersionCheck::getCurrentDBVersion方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: index

 /**
  * Display conference management index page.
  */
 function index($args, &$request)
 {
     // Manager requests should come to the Conference context, not Sched Conf
     if ($request->getRequestedSchedConfPath() != 'index') {
         $request->redirect(null, 'index', 'manager');
     }
     $this->validate();
     $this->setupTemplate($request);
     $conference =& $request->getConference();
     $templateMgr =& TemplateManager::getManager($request);
     // Display a warning message if there is a new version of OJS available
     $newVersionAvailable = false;
     if (Config::getVar('general', 'show_upgrade_warning')) {
         import('lib.pkp.classes.site.VersionCheck');
         if ($latestVersion = VersionCheck::checkIfNewVersionExists()) {
             $newVersionAvailable = true;
             $templateMgr->assign('latestVersion', $latestVersion);
             $currentVersion =& VersionCheck::getCurrentDBVersion();
             $templateMgr->assign('currentVersion', $currentVersion->getVersionString());
             // Get contact information for site administrator
             $roleDao = DAORegistry::getDAO('RoleDAO');
             $siteAdmins =& $roleDao->getUsersByRoleId(ROLE_ID_SITE_ADMIN);
             $templateMgr->assign_by_ref('siteAdmin', $siteAdmins->next());
         }
     }
     $templateMgr->assign('newVersionAvailable', $newVersionAvailable);
     $schedConfDao = DAORegistry::getDAO('SchedConfDAO');
     $schedConfs = $schedConfDao->getAll(false, $conference->getId());
     $templateMgr->assign_by_ref('schedConfs', $schedConfs);
     $templateMgr->assign('announcementsEnabled', $conference->getSetting('enableAnnouncements'));
     $templateMgr->assign('helpTopicId', 'conference.index');
     $templateMgr->display(ROLE_PATH_MANAGER . '/index.tpl');
 }
開發者ID:artkuo,項目名稱:ocs,代碼行數:36,代碼來源:ManagerHandler.inc.php

示例2: index

 /**
  * Display journal management index page.
  */
 function index($args, $request)
 {
     $this->setupTemplate($request);
     $journal = $request->getJournal();
     $templateMgr = TemplateManager::getManager($request);
     // Display a warning message if there is a new version of OJS available
     $newVersionAvailable = false;
     if (Config::getVar('general', 'show_upgrade_warning')) {
         import('lib.pkp.classes.site.VersionCheck');
         if ($latestVersion = VersionCheck::checkIfNewVersionExists()) {
             $newVersionAvailable = true;
             $templateMgr->assign('latestVersion', $latestVersion);
             $currentVersion = VersionCheck::getCurrentDBVersion();
             $templateMgr->assign('currentVersion', $currentVersion->getVersionString());
             // Get contact information for site administrator
             $roleDao = DAORegistry::getDAO('RoleDAO');
             $siteAdmins = $roleDao->getUsersByRoleId(ROLE_ID_SITE_ADMIN);
             $templateMgr->assign('siteAdmin', $siteAdmins->next());
         }
     }
     $templateMgr->assign('newVersionAvailable', $newVersionAvailable);
     $templateMgr->assign('publishingMode', $journal->getSetting('publishingMode'));
     $templateMgr->assign('announcementsEnabled', $journal->getSetting('enableAnnouncements'));
     $session = $request->getSession();
     $session->unsetSessionVar('enrolmentReferrer');
     $templateMgr->display('manager/index.tpl');
 }
開發者ID:utlib,項目名稱:ojs,代碼行數:30,代碼來源:ManagerHandler.inc.php

示例3: index

 /**
  * Display site admin index page.
  */
 function index($args, &$request)
 {
     $this->validate();
     $this->setupTemplate($request);
     $templateMgr =& TemplateManager::getManager();
     // Display a warning message if there is a new version of OJS available
     $newVersionAvailable = false;
     if (Config::getVar('general', 'show_upgrade_warning')) {
         import('lib.pkp.classes.site.VersionCheck');
         if ($latestVersion = VersionCheck::checkIfNewVersionExists()) {
             $newVersionAvailable = true;
             $templateMgr->assign('latestVersion', $latestVersion);
             $currentVersion =& VersionCheck::getCurrentDBVersion();
             $templateMgr->assign('currentVersion', $currentVersion->getVersionString());
         }
     }
     $templateMgr->assign('newVersionAvailable', $newVersionAvailable);
     $templateMgr->display('admin/index.tpl');
 }
開發者ID:Rygbee,項目名稱:harvester,代碼行數:22,代碼來源:AdminHandler.inc.php

示例4: journal

 /**
  * Display The Journal page.
  * @param $args array
  * @param $request PKPRequest
  */
 function journal($args, $request)
 {
     $templateMgr = TemplateManager::getManager($request);
     $this->setupTemplate($request);
     // Display a warning message if there is a new version of OJS available
     if (Config::getVar('general', 'show_upgrade_warning')) {
         import('lib.pkp.classes.site.VersionCheck');
         if ($latestVersion = VersionCheck::checkIfNewVersionExists()) {
             $templateMgr->assign('newVersionAvailable', true);
             $templateMgr->assign('latestVersion', $latestVersion);
             $currentVersion = VersionCheck::getCurrentDBVersion();
             $templateMgr->assign('currentVersion', $currentVersion->getVersionString());
             // Get contact information for site administrator
             $roleDao = DAORegistry::getDAO('RoleDAO');
             $siteAdmins = $roleDao->getUsersByRoleId(ROLE_ID_SITE_ADMIN);
             $templateMgr->assign('siteAdmin', $siteAdmins->next());
         }
     }
     $templateMgr->display('management/settings/journal.tpl');
 }
開發者ID:bkroll,項目名稱:ojs,代碼行數:25,代碼來源:SettingsHandler.inc.php

示例5: 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

示例6: 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


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