我可以使用Symfony new创建一个仅限控制台的项目吗?



我没有通过symfony new <prj_name>启动项目,而是使用了composer require symfony/console。我无法访问任何生成命令。

我这样做做错了吗?如果我使用composer require如何自动创建初始箱/控制台?

因此

,在我开始使用仅composer require symfony/console并且必须手动创建控制台.php文件的现有项目中,我执行以下操作:

需要 Sensio 捆绑包:

$ composer require sensio/generator-bundle

然后,在控制台.php中,需要 Sensio 捆绑包

.
.
.
use SensioBundleGeneratorBundleCommandGenerateCommandCommand;
.
.
.
$console->add(new GenerateCommandCommand());

现在,当我运行控制台.php文件时,帮助文本显示指向该命令的链接。

$ 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

相关内容

最新更新