Skip to content

Instantly share code, notes, and snippets.

@dextervip
Created May 20, 2013 19:56
Show Gist options
  • Save dextervip/5614992 to your computer and use it in GitHub Desktop.
Save dextervip/5614992 to your computer and use it in GitHub Desktop.
Criando um bundle
C:\htdocs\smileflame>php app\console
Symfony version 2.3.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|vv|vvv Increase the verbosity of messages: 1 for normal ou
tput, 2 for more verbose output and 3 for debug
--version -V Display this application version.
--ansi Force ANSI output.
--no-ansi Disable ANSI output.
--no-interaction -n Do not ask any interactive question.
--shell -s Launch the shell.
--process-isolation Launch commands from shell as a separate process.
--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 Installs bundles web assets under a publ
ic web directory
cache
cache:clear Clears the cache
cache:warmup Warms up an empty cache
config
config:dump-reference Dumps default configuration for an exten
sion
container
container:debug Displays current services for an applica
tion
doctrine
doctrine:cache:clear-metadata Clears all metadata cache for an entity
manager
doctrine:cache:clear-query Clears all query cache for an entity man
ager
doctrine:cache:clear-result Clears result cache for an entity manage
r
doctrine:database:create Creates the configured databases
doctrine:database:drop Drops the configured databases
doctrine:ensure-production-settings Verify that Doctrine is properly configu
red for a production environment.
doctrine:generate:crud Generates a CRUD based on a Doctrine ent
ity
doctrine:generate:entities Generates entity classes and method stub
s 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 D
octrine entity
doctrine:mapping:convert Convert mapping information between supp
orted formats.
doctrine:mapping:import Imports mapping information from an exis
ting database
doctrine:mapping:info Shows 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 ge
nerate the database schema
doctrine:schema:drop Executes (or dumps) the SQL needed to dr
op the current database schema
doctrine:schema:update Executes (or dumps) the SQL needed to up
date the database schema to match the current mapping metadata
doctrine:schema:validate Validates the doctrine mapping files
generate
generate:bundle Generates a bundle
generate:controller Generates a controller
generate:doctrine:crud Generates a CRUD based on a Doctrine ent
ity
generate:doctrine:entities Generates entity classes and method stub
s 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 D
octrine entity
init
init:acl Mounts ACL tables in the database
router
router:debug Displays current routes for an applicati
on
router:dump-apache Dumps all routes as Apache rewrite rules
router:match Helps debug routes by simulating a path
info match
server
server:run Runs PHP built-in web server
swiftmailer
swiftmailer:spool:send Sends emails from the spool
translation
translation:update Updates the translation file
twig
twig:lint Lints a template and outputs encountered
errors
C:\htdocs\smileflame>php app\console generate:bundle
Welcome to the Symfony2 bundle generator
Your application code must be written in bundles. This command helps
you generate them easily.
Each bundle is hosted under a namespace (like Acme/Bundle/BlogBundle).
The namespace should begin with a "vendor" name like your company name, your
project name, or your client name, followed by one or more optional category
sub-namespaces, and it should end with the bundle name itself
(which must have Bundle as a suffix).
See http://symfony.com/doc/current/cookbook/bundles/best_practices.html#index-1
for more
details on bundle naming conventions.
Use / instead of \ for the namespace delimiter to avoid any problem.
Bundle namespace: BHW/Smileflame/AppBundle
In your code, a bundle is often referenced by its name. It can be the
concatenation of all namespace parts but it's really up to you to come
up with a unique name (a good practice is to start with the vendor name).
Based on the namespace, we suggest BHWSmileflameAppBundle.
Bundle name [BHWSmileflameAppBundle]:
The bundle can be generated anywhere. The suggested default directory uses
the standard conventions.
Target directory [C:/htdocs/smileflame/src]:
Determine the format to use for the generated configuration.
Configuration format (yml, xml, php, or annotation): annotation
To help you get started faster, the command can generate some
code snippets for you.
Do you want to generate the whole directory structure [no]? yes
Summary before generation
You are going to generate a "BHW\Smileflame\AppBundle\BHWSmileflameAppBundle" bu
ndle
in "C:/htdocs/smileflame/src/" using the "annotation" format.
Do you confirm generation [yes]?
Bundle generation
Generating the bundle code: OK
Checking that the bundle is autoloaded: OK
Confirm automatic update of your Kernel [yes]?
Enabling the bundle inside the Kernel: OK
Confirm automatic update of the Routing [yes]?
Importing the bundle routing resource: OK
You can now start using the generated code!
C:\htdocs\smileflame>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment