0

Instead of starting a project via symfony new <prj_name>, I used composer require symfony/console. I am unable to access any of the generate commands.

Am I going about this incorrectly? If I use composer require how do I automate the creation of the initial bin/console?

2

1 Answer 1

0

So in the existing project that I started using only composer require symfony/console and had to manually create the console.php file, I did the following:

Require the Sensio Bundle:

$ composer require sensio/generator-bundle

Then, in console.php, require the Sensio Bundle

.
.
.
use Sensio\Bundle\GeneratorBundle\Command\GenerateCommandCommand;
.
.
.
$console->add(new GenerateCommandCommand());

Now when I run the console.php file, the help text shows a link to that command.

$ php console.php 
Console Tool

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  help              Displays help for a command
  list              Lists commands
 generate
  generate:command  Generates a console command
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.