News Feed
Jobs Feed
Sections




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

Benjamin Eberlei:
Feature Flags and Doctrine Entities
December 06, 2013 @ 09:40:00

In a new post to his site Benjamin Eberlei takes a look at the idea of "feature flags" (settings to turn on and off major features) and how they can be used with Doctrine entities to handle sync issues between new properties and the database schema.

The problem of feature flags with Doctrine is easily explained: If you add properties for a new feature that is disabled in the Doctrine metadata, then you need to upgrade the database before deployment, even when the feature is not being rolled out for some days/weeks. Doctrine requires the database to look exactly like the metadata specifies it.

His solution was to use the "loadClassMetadata" event in the entity to dynamically append these new properties based on simple "if" checks of feature flags in the configuration object. Obviously using this is a bit of a hack until the new properties are in place, but once they are then the only change is removing this code.

0 comments voice your opinion now!
feature flag doctrine entities class metadata if check

Link: http://www.whitewashing.de/2013/12/05/feature_flags_and_doctrine_entities.html

blog comments powered by Disqus

Similar Posts

PHPClasses.org: A PHP killer feature - Streams abstraction

ProDevTips Blog: Fluent Arrays and Strings in PHP

Blue Parabola Blog: Magento Feature Analysis Series, Part 8: Payment Offering

Jeff Moore's Blog: Let Your Properties be Properties

Strattonbrazil's Blog: php to python: Why PHP is now dead to me


Community Events











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


code release introduction language composer symfony2 security opinion install threedevsandamaybe podcast hhvm application component package facebook series hack framework unittest

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