如何使用Symfony控制台初始化:bundle?

[英]How to use Symfony console to init:bundle?


i run this command: php app/console

我运行此命令:php app / console

Symfony version 2.0.0-RC1 - app/dev/debug

Usage:
  [options] command [arguments]

Options:
  --help           -h Display this help message.
  --quiet          -q Do not output any message.
  --verbose        -v Increase verbosity of messages.
  --version        -V Display this program version.
  --ansi              Force ANSI output.
  --no-ansi           Disable ANSI output.
  --no-interaction -n Do not ask any interactive question.
  --shell          -s Launch the shell.
  --env            -e The Environment name.
  --no-debug          Switches off debug mode.

Available commands:
  help                                  Displays help for a command
  list                                  Lists commands
assetic
  assetic:dump                          Dumps all assets to the filesystem
assets
  assets:install                        
cache
  cache:clear                           Clear the cache
  cache:warmup                          Warms up an empty cache
container
  container:debug                       Displays current services for an application
doctrine
  doctrine:cache:clear-metadata         Clear all metadata cache for a entity manager
  doctrine:cache:clear-query            Clear all query cache for a entity manager
  doctrine:cache:clear-result           Clear result cache for a entity manager
  doctrine:database:create              Create the configured databases
  doctrine:database:drop                Drop the configured databases
  doctrine:ensure-production-settings   Verify that Doctrine is properly configured for a production environment.
  doctrine:generate:crud                Generates a CRUD based on a Doctrine entity
  doctrine:generate:entities            Generate entity classes and method stubs from your mapping information
  doctrine:generate:entity              Generates a new Doctrine entity inside a bundle
  doctrine:generate:form                Generates a form type class based on a Doctrine entity
  doctrine:mapping:convert              Convert mapping information between supported formats.
  doctrine:mapping:import               Import mapping information from an existing database
  doctrine:mapping:info                 Show basic information about all mapped entities
  doctrine:query:dql                    Executes arbitrary DQL directly from the command line.
  doctrine:query:sql                    Executes arbitrary SQL directly from the command line.
  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.
generate
  generate:bundle                       Generates a bundle
  generate:doctrine:crud                Generates a CRUD based on a Doctrine entity
  generate:doctrine:entities            Generate entity classes and method stubs from your mapping information
  generate:doctrine:entity              Generates a new Doctrine entity inside a bundle
  generate:doctrine:form                Generates a form type class based on a Doctrine entity
init
  init:acl                              
router
  router:debug                          Displays current routes for an application
  router:dump-apache                    Dumps all routes as Apache rewrite rules
swiftmailer
  swiftmailer:spool:send                Send emails from the spool

i'm following official Symfony documentation (http://symfony.com/doc/current/book/page_creation.html) and i cannot run command:

我正在关注官方的Symfony文档(http://symfony.com/doc/current/book/page_creation.html),我无法运行命令:

php app/console init:bundle Acme/HelloBundle src

[InvalidArgumentException]             
  Command "init:bundle" is not defined. 

How to create my first "Bundle"?

如何创建我的第一个“捆绑”?

3 个解决方案

#1


15  

I just had the same problem and found your post. It seems that the way to create bundle had changed and the book was not updated.

我刚遇到同样的问题,发现了你的帖子。似乎创建包的方式已经改变,书也没有更新。

Just use the generate:bundle instead of init:bundle, without parameters. An assistant will then help you create the bundle.

只需使用generate:bundle而不是init:bundle,不带参数。然后,助理将帮助您创建捆绑包。

#2


1  

Please refer this site for generating bundle. It's very useful

请参考此站点以生成捆绑包。这非常有用

http://symfony.com/blog/symfony2-getting-easier-interactive-generators

http://symfony.com/blog/symfony2-getting-easier-interactive-generators

#3


0  

I am also currently reading this documentation. I have the same problem as you, as a result I used the generate:bundle and manually did something that follows in the manual.

我目前也在阅读本文档。我和你有同样的问题,因此我使用了generate:bundle并手动完成了手册中的内容。

智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2011/06/25/d18e04ff49352de8e6ff1dfe154ecbcd.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告