本文整理汇总了PHP中Piwik\Updater::getComponentsWithUpdateFile方法的典型用法代码示例。如果您正苦于以下问题:PHP Updater::getComponentsWithUpdateFile方法的具体用法?PHP Updater::getComponentsWithUpdateFile怎么用?PHP Updater::getComponentsWithUpdateFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Updater
的用法示例。
在下文中一共展示了Updater::getComponentsWithUpdateFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getComponentUpdates
public static function getComponentUpdates(Updater $updater)
{
$updater->addComponentToCheck('core', Version::VERSION);
$plugins = \Piwik\Plugin\Manager::getInstance()->getLoadedPlugins();
foreach ($plugins as $pluginName => $plugin) {
$updater->addComponentToCheck($pluginName, $plugin->getVersion());
}
$componentsWithUpdateFile = $updater->getComponentsWithUpdateFile();
if (count($componentsWithUpdateFile) == 0 && !$updater->hasNewVersion('core')) {
return null;
}
return $componentsWithUpdateFile;
}
示例3: testUpdaterChecksCoreAndPluginCheckThatCoreIsRanFirst
public function testUpdaterChecksCoreAndPluginCheckThatCoreIsRanFirst()
{
$updater = new Updater();
$updater->pathUpdateFilePlugins = PIWIK_INCLUDE_PATH . '/tests/resources/Updater/%s/';
$updater->pathUpdateFileCore = PIWIK_INCLUDE_PATH . '/tests/resources/Updater/core/';
$updater->recordComponentSuccessfullyUpdated('testpluginUpdates', '0.1beta');
$updater->addComponentToCheck('testpluginUpdates', '0.1');
$updater->recordComponentSuccessfullyUpdated('core', '0.1');
$updater->addComponentToCheck('core', '0.3');
$componentsWithUpdateFile = $updater->getComponentsWithUpdateFile();
$this->assertEquals(2, count($componentsWithUpdateFile));
reset($componentsWithUpdateFile);
$this->assertEquals('core', key($componentsWithUpdateFile));
}
示例4: getComponentUpdates
public static function getComponentUpdates(Updater $updater)
{
$updater->addComponentToCheck('core', Version::VERSION);
$manager = \Piwik\Plugin\Manager::getInstance();
$plugins = $manager->getLoadedPlugins();
foreach ($plugins as $pluginName => $plugin) {
if ($manager->isPluginInstalled($pluginName)) {
$updater->addComponentToCheck($pluginName, $plugin->getVersion());
}
}
$columnsVersions = ColumnsUpdater::getAllVersions();
foreach ($columnsVersions as $component => $version) {
$updater->addComponentToCheck($component, $version);
}
$componentsWithUpdateFile = $updater->getComponentsWithUpdateFile();
if (count($componentsWithUpdateFile) == 0) {
ColumnsUpdater::onNoUpdateAvailable($columnsVersions);
if (!$updater->hasNewVersion('core')) {
return null;
}
}
return $componentsWithUpdateFile;
}