News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Graham Christensen's Blog:
Sane Pre-Commit Hooks for Symfony + Git
August 25, 2009 @ 13:49:16

Symfony users will want to check out this pre-commit hook for git from Graham Christensen that can help you keep your sanity in place by rebuilding some of the essentials when a commit is made.

Throughout my history of working with Symfony, I've noticed a trend that I'll make a minor edit in a database configuration file, forget to actually regenerate the models and forms, commit the edit, and then find several days later (when I do want to regenerate the models) that they're breaking. I then do this little dance of going through the history finding out where exactly I went wrong.

To remedy the situation he came up with a pre-commit hook that does the following:

  • rebuilds SQL from schemas
  • rebuilds models
  • rebuilds forms
  • rebuilds filters
  • inserts sample SQL data
  • loads all data from the fixture files

Full example code for the hook is included in the post.

0 comments voice your opinion now!
symfony framework precommit hook rebuild


blog comments powered by Disqus

Similar Posts

Benjamin Eberlei: Symfony All The Things (Web)

Davey Shafik's Blog: And The Winner Is...

Felix Geisendörfer's Blog: Welcome to the Dark Side of Plugins in CakePHP

Davey Shafik's Blog: Sneak Peek: Zend_Service_Server - name and framework subject to change

Fabien Potencier: SensioLabs raises 5 million euros to boost the Symfony ecosystem


Community Events

Don't see your event here?
Let us know!


example framework laravel5 php7 podcast release laravel opinion voicesoftheelephpant install community language extension introduction unittest interview api version library series

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework