1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace Application\Migrations;
- use Doctrine\DBAL\Migrations\AbstractMigration;
- use Doctrine\DBAL\Schema\Schema;
- use Symfony\Component\DependencyInjection\ContainerAwareInterface;
- use Symfony\Component\DependencyInjection\ContainerInterface;
- use Symfony\Component\Process\Process;
- /**
- * Migración que corre el comando init:templates:docsis para cargar los modelos y template docsis
- */
- class Version20180117141124 extends AbstractMigration implements ContainerAwareInterface
- {
- /**
- * @var ContainerInterface
- */
- private $container;
- /**
- * @param ContainerInterface $container
- */
- public function setContainer(ContainerInterface $container = null)
- {
- $this->container = $container;
- }
- /**
- * @param Schema $schema
- */
- public function up(Schema $schema)
- {
- $consolePath = $this->container->get('kernel')->getRootDir() . '/../bin/console';
- $process = new Process("{$consolePath} init:templates:docsis");
- $process->run();
- $content = $process->getOutput();
- echo $content;
- }
- public function down(Schema $schema)
- {
- }
- }
|