Skip to content

Instantly share code, notes, and snippets.

@liuggio
Created September 24, 2014 11:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liuggio/e927a86c8fa4dadbe828 to your computer and use it in GitHub Desktop.
Save liuggio/e927a86c8fa4dadbe828 to your computer and use it in GitHub Desktop.
initORM.php
#!/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