Created
September 24, 2014 11:05
-
-
Save liuggio/e927a86c8fa4dadbe828 to your computer and use it in GitHub Desktop.
initORM.php
This file contains 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 | |
function executing($cmd) { | |
echo $cmd.PHP_EOL; | |
system($cmd); | |
} | |
function runInit($env) { | |
executing('php app/console --env='. $env .' doctrine:database:drop --force'); | |
executing('php app/console --env='. $env .' doctrine:database:create'); | |
executing('php app/console --env='. $env .' doctrine:schema:create'); | |
executing('echo -ne "Y\n" | php app/console --env='. $env .' doctrine:fixtures:load'); | |
executing('php app/console assets:install --symlink web --env='. $env); | |
} | |
array_shift($argv); | |
if (!isset($argv[0])) { | |
exit(<<<EOF | |
Init doctrine:orm | |
Specify the Env: eg test | |
EOF | |
); | |
} | |
runInit(array_shift($argv)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment