/**
* @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));
}