Skip to content

Instantly share code, notes, and snippets.

@jiglesiasabio
Last active December 20, 2015 02:29
Show Gist options
  • Save jiglesiasabio/6057124 to your computer and use it in GitHub Desktop.
Save jiglesiasabio/6057124 to your computer and use it in GitHub Desktop.
Symfony2 terminal cheat sheet work in process!

Symfony2 terminal cheatSheet

##Symfony

Create bundle

php app/console generate:bundle

List all routes

php app/console router:debug

Doctrine

###Drop database: php app/console doctrine:database:drop --force

###Create database: php app/console doctrine:database:create

###Create Entity: php app/console doctrine:generate:entity

###Generate getters & setters for an entity: php app/console doctrine:generate:entities Acme/StoreBundle/Entity/Product

###Create / Update Schema php app/console doctrine:schema:update --force

###Load fixtures php app/console doctrine:fixtures:load

###Create empty Migration file php app/console doctrine:migrations:generate

###Create Migration by diff (before updating schema!) php app/console doctrine:migrations:diff

###Migrate to current version php app/console doctrine:migrations:migrate

Caching

Cache Clear Dev

php app/console cache:clear

Cache Clear Prod

php app/console cache:clear --env=prod

Translations

Create/Update translation file

php app/console translation:update es AcmeBundle --force

Assetic

Dump all assets

php app/console assetic:dump --env=prod --no-debug

Dump (with watcher)

php app/console assetic:dump --watch

FOS User Bundle

https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/doc/command_line_tools.md

Create test user

php app/console fos:user:create testuser [email protected] p@ssword

Create Admin user

php app/console fos:user:create adminuser --super-admin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment