本文整理汇总了PHP中Piwik\Updater::addComponentToCheck方法的典型用法代码示例。如果您正苦于以下问题:PHP Updater::addComponentToCheck方法的具体用法?PHP Updater::addComponentToCheck怎么用?PHP Updater::addComponentToCheck使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Updater
的用法示例。
在下文中一共展示了Updater::addComponentToCheck方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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));
}
示例2: dispatch
public function dispatch()
{
$module = Common::getRequestVar('module', '', 'string');
$action = Common::getRequestVar('action', '', 'string');
$updater = new Updater();
$updater->addComponentToCheck('core', Version::VERSION);
$updates = $updater->getComponentsWithNewVersion();
if (!empty($updates)) {
Filesystem::deleteAllCacheOnUpdate();
}
if (self::getComponentUpdates($updater) !== null && $module != 'CoreUpdater' && $module != 'Proxy' && !($module == 'LanguagesManager' && $action == 'saveLanguage')) {
if (FrontController::shouldRethrowException()) {
throw new Exception("Piwik and/or some plugins have been upgraded to a new version. \n" . "--> Please run the update process first. See documentation: http://piwik.org/docs/update/ \n");
} else {
Piwik::redirectToModule('CoreUpdater');
}
}
}