2011-06-25 5 views
8

मैं इस कमांड चलाएँ: php एप्लिकेशन/कंसोलinit में सिम्फनी कंसोल का उपयोग कैसे करें: बंडल?

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 

मैं आधिकारिक 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. 

मेरा पहला "बंडल" कैसे बनाएं?

उत्तर

15

मुझे बस एक ही समस्या थी और आपकी पोस्ट मिली। ऐसा लगता है कि बंडल बनाने का तरीका बदल गया था और पुस्तक अद्यतन नहीं हुई थी।

पैरामीटर के बिना init:bundle के बजाय बस generate:bundle का उपयोग करें। एक सहायक तब आपको बंडल बनाने में मदद करेगा।

+0

'php एप्लिकेशन/कंसोल उत्पन्न है: bundle' (पैरामीटर के बिना) – Serjas

+0

मैं एक ही उपयोग कर रहा हूँ (php एप्लिकेशन/कंसोल उत्पन्न: बंडल) .लेकिन मेरे लिए त्रुटि अभी भी विद्यमान है। बहुत उपयोगी वीडियो के लिए – pinku

0

मैं वर्तमान में इस दस्तावेज़ को पढ़ रहा हूं। मुझे आपके जैसा ही समस्या है, नतीजतन मैंने generate:bundle का उपयोग किया और मैन्युअल रूप से मैन्युअल में कुछ ऐसा किया।