Improved commands
This commit is contained in:
parent
4f1cc4ce05
commit
35a56e8ca8
|
@ -39,10 +39,12 @@ EOT
|
|||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ($input->getOption('verbose')) {
|
||||
$this->additionalPhingArgs[]= 'verbose';
|
||||
$this->additionalPhingArgs[] = 'verbose';
|
||||
}
|
||||
|
||||
if (true === $this->callPhing('om')) {
|
||||
$this->writeSection($output, '[Propel] You are running the command: propel:build-model');
|
||||
|
||||
foreach ($this->tempSchemas as $schemaFile => $schemaDetails) {
|
||||
$output->writeln(sprintf(
|
||||
'Built Model classes for bundle <info>%s</info> from <comment>%s</comment>.',
|
||||
|
|
|
@ -43,10 +43,12 @@ EOT
|
|||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ($input->getOption('verbose')) {
|
||||
$this->additionalPhingArgs[]= 'verbose';
|
||||
$this->additionalPhingArgs[] = 'verbose';
|
||||
}
|
||||
|
||||
if (true === $this->callPhing('sql', array('propel.packageObjectModel' => false))) {
|
||||
$this->writeSection($output, '[Propel] You are running the command: propel:build-sql');
|
||||
|
||||
$filesystem = new Filesystem();
|
||||
$basePath = $this->getApplication()->getKernel()->getRootDir(). DIRECTORY_SEPARATOR . 'propel'. DIRECTORY_SEPARATOR . 'sql';
|
||||
$sqlMap = file_get_contents($basePath . DIRECTORY_SEPARATOR . 'sqldb.map');
|
||||
|
|
|
@ -33,6 +33,8 @@ class DatabaseCreateCommand extends PhingCommand
|
|||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->writeSection($output, '[Propel] You are running the command: propel:database:create');
|
||||
|
||||
list($name, $config) = $this->getConnection($input, $output);
|
||||
$dbName = $this->parseDbName($config['connection']['dsn']);
|
||||
$query = 'CREATE DATABASE '. $dbName .';';
|
||||
|
|
|
@ -45,6 +45,8 @@ EOT
|
|||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ($input->getOption('force')) {
|
||||
$this->writeSection($output, '[Propel] You are running the command: propel:database:drop');
|
||||
|
||||
list($name, $config) = $this->getConnection($input, $output);
|
||||
$dbName = $this->parseDbName($config['connection']['dsn']);
|
||||
$query = 'DROP DATABASE '. $dbName .';';
|
||||
|
|
|
@ -45,6 +45,8 @@ EOT
|
|||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
if ($input->getOption('force')) {
|
||||
$this->writeSection($output, '[Propel] You are running the command: propel:insert-sql');
|
||||
|
||||
list($name, $defaultConfig) = $this->getConnection($input, $output);
|
||||
|
||||
$ret = $this->callPhing('insert-sql', array(
|
||||
|
|
|
@ -79,18 +79,18 @@ EOT
|
|||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->writeSection($output, '[Propel] You are running the command: propel:load-fixtures');
|
||||
|
||||
$this->absoluteFixturesPath = $this->getApplication()->getKernel()->getRootDir() . DIRECTORY_SEPARATOR . $input->getOption('dir');
|
||||
$this->filesystem = new Filesystem();
|
||||
|
||||
$noOptions = (!$input->getOption('xml') && !$input->getOption('sql'));
|
||||
|
||||
if ($input->getOption('xml') || $noOptions)
|
||||
{
|
||||
if ($input->getOption('xml') || $noOptions) {
|
||||
$this->loadXmlFixtures($input, $output);
|
||||
}
|
||||
|
||||
if ($input->getOption('sql') || $noOptions)
|
||||
{
|
||||
if ($input->getOption('sql') || $noOptions) {
|
||||
$this->loadSqlFixtures($input, $output);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue