setOutputWriter() 공개 메소드

Sets the output writer.
public setOutputWriter ( Doctrine\DBAL\Migrations\OutputWriter $outputWriter )
$outputWriter Doctrine\DBAL\Migrations\OutputWriter
 /**
  * @Route("/{connectionName}/execute/{version}")
  * @Method("POST")
  */
 public function executeAction($connectionName, $version)
 {
     $connection = $this->getDoctrine()->getConnection($connectionName);
     $outputWriter = new MemoryOutputWriter();
     $configuration = new Configuration($connection);
     $configuration->setName($this->container->getParameter('doctrine_migrations.name'));
     $configuration->setOutputWriter($outputWriter);
     $configuration->setMigrationsTableName($this->container->getParameter('doctrine_migrations.table_name'));
     $configuration->setMigrationsDirectory($this->container->getParameter('doctrine_migrations.dir_name'));
     $configuration->setMigrationsNamespace($this->container->getParameter('doctrine_migrations.namespace'));
     $migration = new Migration($configuration);
     $currentVersion = $configuration->getCurrentVersion();
     $dryRun = false;
     $migration->setNoMigrationException(true);
     $sql = $migration->migrate($version, $dryRun, true);
     return $this->render('MarkeiDoctrineMigrationWebBundle:Migrate:execute.html.twig', ['connectionName' => $connectionName, 'to' => $version, 'from' => $currentVersion, 'output' => $outputWriter->getMemory(), 'name' => $this->container->getParameter('doctrine_migrations.name')]);
 }