getSqlQueriesToExecute() public method

Returns the list of SQL queries that would be executed during the update
public getSqlQueriesToExecute ( ) : Sql[]
return Piwik\Updater\Migration\Db\Sql[] of SQL queries
コード例 #1
0
 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
0
ファイル: Update.php プロジェクト: piwik/piwik
 private function getMigrationQueriesToExecute(Updater $updater)
 {
     if (empty($this->migrationQueries)) {
         $this->migrationQueries = $updater->getSqlQueriesToExecute();
     }
     return $this->migrationQueries;
 }