Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/274.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在symfony2中显示一个命名空间的命令_Php_Symfony - Fatal编程技术网

Php 在symfony2中显示一个命名空间的命令

Php 在symfony2中显示一个命名空间的命令,php,symfony,Php,Symfony,有没有办法只显示一个名称空间的所有命令?比如说,所有的命令都只是条令 这真的很好,因为我有很多命令和很多命令名称空间 我确实知道| grep,但正在寻找一个内置的symfony选项(如果存在的话) 鉴于我使用的是symfony2.0 仅输入名称空间的开头以列出可用命令: $ php app/console doctrine [InvalidArgumentException] Command "doctrine" is not defined.

有没有办法只显示一个名称空间的所有命令?比如说,所有的命令都只是条令

这真的很好,因为我有很多命令和很多命令名称空间

我确实知道
| grep
,但正在寻找一个内置的symfony选项(如果存在的话)

鉴于我使用的是symfony2.0


仅输入名称空间的开头以列出可用命令:

$ php app/console doctrine

  [InvalidArgumentException]               
  Command "doctrine" is not defined.       
  Did you mean one of these?               
      doctrine:query:sql                   
      doctrine:query:dql                   
      doctrine:schema:drop                 
      doctrine:mapping:info                
      […]
但如果该数字较低,则不会显示所有命令:

$ php app/console doctrine:cache
  [InvalidArgumentException]                                                                                   
  Command "doctrine:cache" is ambiguous (doctrine:cache:clear-result, doctrine:cache:clear-query and 1 more).
也可以使用
列表
命令,它将对命令进行排序并添加说明:

$ php app/console list doctrine
Symfony version 2.3.28 - app/dev/debug

Usage:
  command [options] [arguments]

Options:
  --help           -h Display this help message
  […]

Available commands for the "doctrine" namespace:
  doctrine:cache:clear-metadata         Clears all metadata cache for an entity manager
  doctrine:cache:clear-query            Clears all query cache for an entity manager
  doctrine:cache:clear-result           Clears result cache for an entity manager
  doctrine:database:create              Creates the configured databases
  doctrine:database:drop                Drops the configured databases
  doctrine:ensure-production-settings   Verify that Doctrine is properly configured for a production environment.
  […]
  doctrine:schema:create                Executes (or dumps) the SQL needed to generate the database schema
  doctrine:schema:drop                  Executes (or dumps) the SQL needed to drop the current database schema
  doctrine:schema:update                Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata
  doctrine:schema:validate              Validates the doctrine mapping files

$ php app/console list doctrine:cache
Symfony version 2.3.28 - app/dev/debug

[…]

Available commands for the "doctrine:cache" namespace:
  doctrine:cache:clear-metadata   Clears all metadata cache for an entity manager
  doctrine:cache:clear-query      Clears all query cache for an entity manager
  doctrine:cache:clear-result     Clears result cache for an entity manager

在我发布关于
grep
的文章时,您正确地进行了编辑。我不相信有一个内置选项,可能是因为
grep
非常容易获得。:D这确实有效,但不适用于symfony2.0:/,我想我必须使用
grep
考虑升级到2.3或2.7。你的版本很好old@smarber它与Symfony 2.3.28和2.6.7一起工作,但我不确定这是否是预期的行为,因为它每次都显示帮助块。。。