0

I just created a custom class that will do more commands. This command will be launched by a robot in the future.

But when I do a

$command_fixtures_load = $this->getApplication()->find('doctrine:fixtures:load');
        $arguments_fixtures_load = array(
            'command' => 'doctrine:fixtures:load',
            '--fixtures' => "src/XXX/XXXBundle/Tests/DataFixtures"
        );
        $input_fixtures_load = new ArrayInput($arguments_fixtures_load);
        $command_fixtures_load->run($input_fixtures_load, $output);

I have this :

Careful, database will be purged. Do you want to continue Y/N ?

So the script waits for an answer, or I would give no answer but it makes the load Fixtures fully automatic.

How?

Sworios
  • 37
  • 1
  • 9
  • See the accepted answer and comments from here: http://stackoverflow.com/questions/10497567/how-can-i-run-symfony-2-run-command-from-controller – cheesemacfly Jul 22 '13 at 14:26

1 Answers1

0

Running

php app/console doctrine:fixtures:load --no-interaction

Will purge your database without asking the question.

To see more options run

php app/console doctrine:fixtures:load --help
ziesta
  • 3
  • 2