Created
April 14, 2017 15:03
-
-
Save akovalyov/a7378f75313fff61652b18246f81d879 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
use Symfony\Bundle\FrameworkBundle\Console\Application; | |
use Symfony\Component\Console\Input\ArgvInput; | |
use Symfony\Component\Debug\Debug; | |
// if you don't want to setup permissions the proper way, just uncomment the following PHP line | |
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information | |
//umask(0000); | |
set_time_limit(0); | |
/** @var Composer\Autoload\ClassLoader $loader */ | |
$loader = require __DIR__.'/../app/autoload.php'; | |
$input = new ArgvInput(); | |
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev'); | |
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod'; | |
if ($debug) { | |
Debug::enable(); | |
} | |
$kernel = new AppKernel($env, $debug); | |
$application = new Application($kernel); | |
$application->setAutoExit(false); | |
$application->run(new \Symfony\Component\Console\Input\ArrayInput([ | |
'command' => 'doctrine:database:drop', | |
'--force' => true, | |
'--if-exists' => true, | |
])); | |
$application->run(new \Symfony\Component\Console\Input\ArrayInput([ | |
'command' => 'doctrine:database:create', | |
])); | |
$application->run(new \Symfony\Component\Console\Input\ArrayInput([ | |
'command' => 'doctrine:migrations:migrate', | |
'--no-interaction' => true, | |
])); | |
$application->run(new \Symfony\Component\Console\Input\ArrayInput([ | |
'command' => 'rad:fixtures:load', | |
])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment