idea and initial content from http://jamandcheese-on-phptoast.com/2011/12/18/symfony2-console-cheat-sheet/
Structure
php app/console generate:bundle --namespace=[namespace]/[bundle name]Bundle --format=[bundle configuration format]
Example
php app/console generate:bundle --namespace=Moo/UserBundle --format=yml
namespace is your company name the prefix that will identify your bundles from other bundles that you may have in your application.
bundle name is what is it for? Examples of bundles: Blog bundle, User management bundle, Forum bundle, and so on. Bundle does not have to be accessbile from the web, you could create a bundle to manage internal functions such as integrating jQuery framework. You can create as many as you like of bundles under your company namespace
There are 3 types of configuration format that you can choose from YML, XML & PHP.
For operating system that does support symlinks
php app/console assets:install web --symlink
For operating system that does not support symlinks
php app/console assets:install web
As I said before bundles can be to manage internal functions (The jQuery bundle). These resources must be located under the directory
/src/[namespace]/[bundle name]Bundle/Resources/public/
This command is going to copy your files or create symlinks under
/web/bundles/[namespace][bundle name]
##CLEAR ENVIROMENT CACHE
Structure
php app/console cache:clear --env=[enviroment name]
Example
php app/console cache:clear --env=prod
–env is the name of the enviroment you want to remove its cache. Each subdirectory under
/app/cache/
is an enviroment.
php bin/vendors install
This commands installs or upgrade the bundles defined in the file
/deps
php app/console doctrine:database:create
This command will create the application database based on the parameters defined in
app/config/parameters.ini
This command will not create tables, it just create an empty database if it does not exists else it will throw an error.
Structure
php app/console doctrine:generate:entities [namespace]
Example
php app/console doctrine:generate:entities Moo
You can run this command after changes to the ORM metadata for the entity classes. It will create getter and setter methods. But it will not modify any of the existing methods.
php app/console doctrine:schema:create
Based on the defined ORM metadata this command will create all of the tables.
If you don’t want to create the tables but return a dump of the SQL queries, then pass the following option
--dump-sql
to the right side of the command.