コード例 #1
0
ファイル: Updater.php プロジェクト: piwik/piwik
 /**
  * @param $file
  * @param Migration $migration
  * @throws UpdaterErrorException
  * @api
  */
 public function executeMigration($file, Migration $migration)
 {
     try {
         $this->executeListenerHook('onStartExecutingMigration', array($file, $migration));
         $migration->exec();
     } catch (\Exception $e) {
         if (!$migration->shouldIgnoreError($e)) {
             $message = sprintf("%s:\nError trying to execute the migration '%s'.\nThe error was: %s", $file, $migration->__toString(), $e->getMessage());
             throw new UpdaterErrorException($message);
         }
     }
     $this->executeListenerHook('onFinishedExecutingMigration', array($file, $migration));
 }
コード例 #2
0
ファイル: CliUpdateObserver.php プロジェクト: piwik/piwik
 public function onStartExecutingMigration($updateFile, Migration $migration)
 {
     $string = $migration->__toString();
     $this->output->write("  Executing <comment>{$string}</comment>... ");
     ++$this->currentMigrationQueryExecutionCount;
 }