本文整理汇总了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));
}
示例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();
}
}
示例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;
}
示例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);
}
示例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);
}
}