Create a gist now

Instantly share code, notes, and snippets.

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