I have a command inside my command folder under my bundle folder. I'm trying to execute it using the windows command prompt or using netbeans. The documentation says to use the bin/console. But I have no idea what is that or how to use it. Please help.
4
-
symfony.com/doc/current/console/usage.htmlRiggsFolly– RiggsFolly2016-09-29 22:44:01 +00:00Commented Sep 29, 2016 at 22:44
-
All I get is: Could not open input file: bin/consoleJesus– Jesus2016-09-29 22:46:29 +00:00Commented Sep 29, 2016 at 22:46
-
php bin/console assuming you have a path set to your php executableCerad– Cerad2016-09-29 22:56:53 +00:00Commented Sep 29, 2016 at 22:56
-
1depends on which version of symfony you are using. If its > 3.0 than it is php bin/console otherwise it is php app/consolePuya Sarmidani– Puya Sarmidani2016-09-30 07:44:40 +00:00Commented Sep 30, 2016 at 7:44
Add a comment
|
1 Answer
in Symfony2, the console is located at /app/console
so if you cd to your application home directory, then run php app/console <name of command>
in the Command class, the name is set:
protected function configure()
{
// to run the console command, use 'php app/console forex:update'
$this->setName('forex:update')
->setDescription('Update Foreign Exchange Rates');
}
in the example above, the command to run it (from the application home directory is:
php app/console forex:update
You may also need to add the php to your PATH, or replace php with the path to your php executable.