Need help?

I'm available for remote short term contracting or consultancy work. Please check out my LinkedIn profile for more details on my experience.

Please feel free to use the form below to contact me.




Most Used Symfony 2 Commands

This is just a compilation of the commands that I use most when using Symfony 2, and I’ll continue to add to it as I find more interesting commands.

1. curl -s https://getcomposer.org/installer | php   

When starting a new project, this would be the first command you’d type (assuming you’re using composer). It’s pretty sweet, though.

2. php composer.phar create-project symfony/framework-standard-edition /path/to/project   

Once we have composer installed, we can run this command to create our project. It’ll manage all your dependancies, and generate your project structure.

3. php composer.phar install   

This command installs all the vendors (dependancies for your project). Some example vendors would be Doctrine and Twig.

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

I find myself using this almost constantly. When committing the latest changes to live, or even when I need to demo, I’ll clear the cache and update production with the latest.

5. php app/console doctrine:generate:entities YourMainBundle   

This checks all your entities in the specified bundle and updates the getters and setters if you added new properties. Great if you’re adding new columns to a model and don’t want to manually add the getters and setters.

6. php app/console doctrine:schema:update --force   

With this command, you’re telling Symfony 2 to update your database with the current schema (entities) that you have in your project. For example, if you just added a new entity/model, you can do a force, and it’ll add a new table to the database, which matches the new model.

7. php app/console generate:bundle   

This command doesn’t get used that often, but it’s pretty common. It creates a new bundle for your project. For more information on Bundles, you can read-up on them here (http://symfony.com/doc/2.0/cookbook/bundles/best_practices.html).

8. php app/console generate:doctrine:entity --entity=YourMainBundle:EntityName --fields=”title:string(100) body:text   

If you need to create a new entity/model from scratch, you’d use this command. Most of the time you’d use this command in unison with the ‘schema:update --force’.


jon | March 10, 2013 | Comments (1)

Comments

chanel handbags
flat iron
converse shoes
salvatore ferragamo
gucci handbags
hollister
north face outlet
north face clearance
burberry factory
ralph lauren uk
polo outlet
polo ralph lauren
insanity workout
jimmy choo
jordan shoes
juicy couture outlet
juicy couture handbags
kate spade
kate spade handbags
louis vuitton
cheap michael kors
michael kors outlet online
michael kors outlet
michael kors outlet online sale
michael kors outlet store
north face, http://www.northface.us.org/
oakley sunglasses
pandora jewelry
prada handbags
prada outlet
ray ban outlet
ray-ban sunglasses
rolex watches
swarovski crystal
north face outlet
tiffany and co
tiffany jewelry
true religion
true religion jeans
ugg australia
ugg boots
ugg boots clearance
uggs on sale
uggs outlet
cheap oakley sunglasses
oakley sunglasses cheap
ralph lauren outlet
polo ralph lauren outlet
burberry
toms shoes
toms outlet
christian louboutin
tory burch outlet
gucci outlet
longchamp
abercrombie
hollister clothing
hermes
nfl jerseys
beats by dre
beats headphones
hair straightener
ray ban sunglasses
michael kors uk
michael kors
marc jacobs handbags
louis vuitton
ralph lauren
nike free
rolex watches
wedding dresses
pandora charms
thomas sabo
swarovski
louboutin shoes
nike huarache
nike roshe
north face
louis vuitton canada
air jordan
jordan retro
cheap jordans
nike factory
nike outlet store
nike shoes
nike air max
nike air max 2015
air max
nike free run
nike free
supra shoes
new balance
mont blanc pens
ferragamo shoes
mcm bags
bottega
nike mercurial
celine handbags
roshe run
nike roshe
vans shoes
timberland boots
iphone cases
baseball bats
babyliss pro
louis vuitton
burberry
louboutin
christian louboutin shoes
louis vuitton bags
prada outlet
michael kors outlet
michael kors outlet online
tommy hilfiger outlet
mcm backpack
moncler outlet store
kate spade outlet online
barbour sale
salvatore ferragamo
canada goose jacket
louis vuitton outlet online
burberry outlet
burberry clothes
the north face
barbour jackets
monster beats outlet
louis vuitton handbags
louis vuitton shoes outlet
longchamp handbags
moncler clearance
ralph lauren shirts
coach handbags
beats by dre outlet
coach outlet
coach outlet online
coach store online
michael kors bags sale
coach factory
cheap oakley
hermes outlet online
air jordans
woolrich arctic parka
coach outlet
coach outlet usa
gucci shoes outlet
coach outlet
michael kors
gucci factory
the north face jackets
cheap ugg boots
tory burch outlet
tommy hilfiger kids
ugg boots
vuitton handbags
cheap calvin kleins
christian louboutin shoes
air jordan shoes
burberry outlet online
abercrombie and fitch
cheap oakley sunglasses
oakley outlet
oakley sunglasses
swarovski jewelry
replica handbags
boots on sale
basketball shoes
chanel sunglasses
true religion outlet
abercrombie and fitch
hermes birkin
yoga pants
gucci shoes
ray ban sunglasses outlet
omega watches
eyeglass frames
eyeglasses online
cheap michael kors
cheap ray ban
ray bans
ray ban wayfarer
easton bats
burberry outlet
christian louboutin outlet
tory burch sandals
soccer shoes
timberland outlet
retro jordans
toms shoes outlet
Comment by ww - May 18, 2015 @ 10:15 pm

Name (required)
Email (will not be published) (required)
Website

captcha