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


PHP Updater::markComponentSuccessfullyUpdated方法代码示例

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


在下文中一共展示了Updater::markComponentSuccessfullyUpdated方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testUpdaterChecksCoreAndPluginCheckThatCoreIsRanFirst

 public function testUpdaterChecksCoreAndPluginCheckThatCoreIsRanFirst()
 {
     $updater = new Updater(PIWIK_INCLUDE_PATH . '/tests/resources/Updater/core/', PIWIK_INCLUDE_PATH . '/tests/resources/Updater/%s/');
     $updater->markComponentSuccessfullyUpdated('testpluginUpdates', '0.1beta');
     $updater->markComponentSuccessfullyUpdated('core', '0.1');
     $componentsWithUpdateFile = $updater->getComponentsWithUpdateFile(array('testpluginUpdates' => '0.1', 'core' => '0.3'));
     $this->assertEquals(2, count($componentsWithUpdateFile));
     reset($componentsWithUpdateFile);
     $this->assertEquals('core', key($componentsWithUpdateFile));
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:10,代码来源:UpdaterTest.php

示例2: installPluginIfNecessary

 /**
  * Install a plugin, if necessary
  *
  * @param Plugin $plugin
  */
 private function installPluginIfNecessary(Plugin $plugin)
 {
     $pluginName = $plugin->getPluginName();
     $saveConfig = false;
     // is the plugin already installed or is it the first time we activate it?
     $pluginsInstalled = $this->getInstalledPluginsName();
     if (!$this->isPluginInstalled($pluginName)) {
         $this->executePluginInstall($plugin);
         $pluginsInstalled[] = $pluginName;
         $this->updatePluginsInstalledConfig($pluginsInstalled);
         $updater = new Updater();
         $updater->markComponentSuccessfullyUpdated($plugin->getPluginName(), $plugin->getVersion());
         $saveConfig = true;
     }
     if ($saveConfig) {
         PiwikConfig::getInstance()->forceSave();
     }
 }
开发者ID:962464,项目名称:piwik,代码行数:23,代码来源:Manager.php

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

示例4: recordComponentSuccessfullyUpdated

 /**
  * Record version of successfully completed component update
  *
  * @param string $name
  * @param string $version
  */
 public static function recordComponentSuccessfullyUpdated($name, $version)
 {
     self::$activeInstance->markComponentSuccessfullyUpdated($name, $version);
 }
开发者ID:piwik,项目名称:piwik,代码行数:10,代码来源:Updater.php

示例5: installPluginIfNecessary

 /**
  * Install a plugin, if necessary
  *
  * @param Plugin $plugin
  */
 private function installPluginIfNecessary(Plugin $plugin)
 {
     $pluginName = $plugin->getPluginName();
     $saveConfig = false;
     // is the plugin already installed or is it the first time we activate it?
     $pluginsInstalled = $this->getInstalledPluginsName();
     if (!$this->isPluginInstalled($pluginName)) {
         $this->executePluginInstall($plugin);
         $pluginsInstalled[] = $pluginName;
         $this->updatePluginsInstalledConfig($pluginsInstalled);
         $updater = new Updater();
         $updater->markComponentSuccessfullyUpdated($plugin->getPluginName(), $plugin->getVersion(), $isNew = true);
         $saveConfig = true;
         /**
          * Event triggered after a new plugin has been installed.
          *
          * Note: Might be triggered more than once if the config file is not writable
          *
          * @param string $pluginName The plugin that has been installed.
          */
         Piwik::postEvent('PluginManager.pluginInstalled', array($pluginName));
     }
     if ($saveConfig) {
         PiwikConfig::getInstance()->forceSave();
         $this->clearCache($pluginName);
     }
 }
开发者ID:piwik,项目名称:piwik,代码行数:32,代码来源:Manager.php


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