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