本文整理匯總了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;
}