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