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


PHP Updater::getCurrentComponentVersion方法代碼示例

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


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

示例1: throwIfPiwikVersionIsOlderThanDBSchema

 /**
  * This method ensures that Piwik Platform cannot be running when using a NEWER database.
  */
 private function throwIfPiwikVersionIsOlderThanDBSchema()
 {
     // When developing this situation happens often when switching branches
     if (Development::isEnabled()) {
         return;
     }
     $updater = new Updater();
     $dbSchemaVersion = $updater->getCurrentComponentVersion('core');
     $current = Version::VERSION;
     if (-1 === version_compare($current, $dbSchemaVersion)) {
         $messages = array(Piwik::translate('General_ExceptionDatabaseVersionNewerThanCodebase', array($current, $dbSchemaVersion)), Piwik::translate('General_ExceptionDatabaseVersionNewerThanCodebaseWait'), Piwik::translate('General_ExceptionContactSupportGeneric', array('', '')));
         throw new DatabaseSchemaIsNewerThanCodebaseException(implode(" ", $messages));
     }
 }
開發者ID:drabberhorizon,項目名稱:ActiveNative,代碼行數:17,代碼來源:FrontController.php

示例2: mixinVersions

 /**
  * @param ActionDimension|ConversionDimension|VisitDimension $dimension
  * @param string $componentPrefix
  * @param array $columns
  * @param array $versions
  * @return array The modified versions array
  */
 private function mixinVersions(PiwikUpdater $updater, $dimension, $componentPrefix, $columns, $versions)
 {
     $columnName = $dimension->getColumnName();
     // dimensions w/o columns do not need DB updates
     if (!$columnName || !$dimension->hasColumnType()) {
         return $versions;
     }
     $component = $componentPrefix . $columnName;
     $version = $dimension->getVersion();
     // if the column exists in the table, but has no associated version, and was one of the core columns
     // that was moved when the dimension refactor took place, then:
     // - set the installed version in the DB to the current code version
     // - and do not check for updates since we just set the version to the latest
     if (array_key_exists($columnName, $columns) && false === $updater->getCurrentComponentVersion($component) && self::wasDimensionMovedFromCoreToPlugin($component, $version)) {
         $updater->markComponentSuccessfullyUpdated($component, $version);
         return $versions;
     }
     $versions[$component] = $version;
     return $versions;
 }
開發者ID:nagyistoce,項目名稱:piwik,代碼行數:27,代碼來源:Updater.php

示例3: getCurrentVersionForCore

 private function getCurrentVersionForCore(Updater $updater)
 {
     $currentVersion = $updater->getCurrentComponentVersion('core');
     if ($currentVersion === false) {
         $currentVersion = "<= 0.2.9";
     }
     return $currentVersion;
 }
開發者ID:piwik,項目名稱:piwik,代碼行數:8,代碼來源:Update.php

示例4: getCurrentRecordedComponentVersion

 /**
  * Retrieve the current version of a recorded component
  * @param string $name
  * @return false|string
  * @throws \Exception
  */
 public static function getCurrentRecordedComponentVersion($name)
 {
     return self::$activeInstance->getCurrentComponentVersion($name);
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:10,代碼來源:Updater.php


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