本文整理汇总了PHP中Piwik\Updater::updateComponents方法的典型用法代码示例。如果您正苦于以下问题:PHP Updater::updateComponents方法的具体用法?PHP Updater::updateComponents怎么用?PHP Updater::updateComponents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Piwik\Updater
的用法示例。
在下文中一共展示了Updater::updateComponents方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doExecuteUpdates
private function doExecuteUpdates($view, DbUpdater $updater, $componentsWithUpdateFile)
{
$result = $updater->updateComponents($componentsWithUpdateFile);
$this->coreError = $result['coreError'];
$this->warningMessages = $result['warnings'];
$this->errorMessages = $result['errors'];
$this->deactivatedPlugins = $result['deactivatedPlugins'];
$view->coreError = $this->coreError;
$view->warningMessages = $this->warningMessages;
$view->errorMessages = $this->errorMessages;
$view->deactivatedPlugins = $this->deactivatedPlugins;
}
示例2: updateDatabase
public static function updateDatabase($force = false)
{
Cache::deleteTrackerCache();
Option::clearCache();
if ($force) {
// remove version options to force update
Option::deleteLike('version%');
Option::set('version_core', '0.0');
}
$updater = new Updater();
$componentsWithUpdateFile = $updater->getComponentUpdates();
if (empty($componentsWithUpdateFile)) {
return false;
}
$result = $updater->updateComponents($componentsWithUpdateFile);
if (!empty($result['coreError']) || !empty($result['warnings']) || !empty($result['errors'])) {
throw new \Exception("Failed to update database (errors or warnings found): " . print_r($result, true));
}
return $result;
}
示例3: doRealUpdate
private function doRealUpdate(Updater $updater, $componentsWithUpdateFile, OutputInterface $output)
{
$output->writeln(array(" " . Piwik::translate('CoreUpdater_TheUpgradeProcessMayTakeAWhilePleaseBePatient'), ""));
$updaterResult = $updater->updateComponents($componentsWithUpdateFile);
if (@$updaterResult['coreError']) {
$this->handleCoreError($output, $updaterResult['errors'], $includeDiyHelp = true);
return;
}
if (!empty($updaterResult['warnings'])) {
$this->outputUpdaterWarnings($output, $updaterResult['warnings']);
}
if (!empty($updaterResult['errors'])) {
$this->outputUpdaterErrors($output, $updaterResult['errors'], $updaterResult['deactivatedPlugins']);
}
if (!empty($updaterResult['warnings']) || !empty($updaterResult['errors'])) {
$output->writeln(array(" " . Piwik::translate('CoreUpdater_HelpMessageIntroductionWhenWarning'), "", " * " . $this->getUpdateHelpMessage()));
}
}
示例4: updateComponents
/**
* @return array|bool
*/
protected function updateComponents()
{
Access::getInstance();
return Access::doAsSuperUser(function () {
$updater = new Updater();
$componentsWithUpdateFile = $updater->getComponentUpdates();
if (empty($componentsWithUpdateFile)) {
return false;
}
$result = $updater->updateComponents($componentsWithUpdateFile);
return $result;
});
}
示例5: updateComponents
/**
* @deprecated
*/
public static function updateComponents(PiwikCoreUpdater $updater, $componentsWithUpdateFile)
{
return $updater->updateComponents($componentsWithUpdateFile);
}