本文整理匯總了PHP中Piwik\Updater::getSqlQueriesToExecute方法的典型用法代碼示例。如果您正苦於以下問題:PHP Updater::getSqlQueriesToExecute方法的具體用法?PHP Updater::getSqlQueriesToExecute怎麽用?PHP Updater::getSqlQueriesToExecute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik\Updater
的用法示例。
在下文中一共展示了Updater::getSqlQueriesToExecute方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: runUpdaterAndExit
public function runUpdaterAndExit($doDryRun = null)
{
$updater = new DbUpdater();
$componentsWithUpdateFile = $updater->getComponentUpdates();
if (empty($componentsWithUpdateFile)) {
throw new NoUpdatesFoundException("Everything is already up to date.");
}
SettingsServer::setMaxExecutionTime(0);
$welcomeTemplate = '@CoreUpdater/runUpdaterAndExit_welcome';
$doneTemplate = '@CoreUpdater/runUpdaterAndExit_done';
$viewWelcome = new View($welcomeTemplate);
$this->addCustomLogoInfo($viewWelcome);
$this->setBasicVariablesView($viewWelcome);
$viewDone = new View($doneTemplate);
$this->addCustomLogoInfo($viewDone);
$this->setBasicVariablesView($viewDone);
$doExecuteUpdates = Common::getRequestVar('updateCorePlugins', 0, 'integer') == 1;
if (is_null($doDryRun)) {
$doDryRun = !$doExecuteUpdates;
}
if ($doDryRun) {
$viewWelcome->queries = $updater->getSqlQueriesToExecute();
$viewWelcome->isMajor = $updater->hasMajorDbUpdate();
$this->doWelcomeUpdates($viewWelcome, $componentsWithUpdateFile);
return $viewWelcome->render();
}
// Web
if ($doExecuteUpdates) {
$this->warningMessages = array();
$this->doExecuteUpdates($viewDone, $updater, $componentsWithUpdateFile);
$this->redirectToDashboardWhenNoError($updater);
return $viewDone->render();
}
exit;
}
示例2: getMigrationQueriesToExecute
private function getMigrationQueriesToExecute(Updater $updater)
{
if (empty($this->migrationQueries)) {
$this->migrationQueries = $updater->getSqlQueriesToExecute();
}
return $this->migrationQueries;
}