News Feed
Sections




News Archive
feed this:

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

Matthew Weier O'Phinney's Blog:
Converting DocBook4 to DocBook5
July 20, 2011 @ 09:55:50

In this new post to his blog Matthew Weier O'Phinney looks at the steps he took to convert over the documentation for the Zend Framework 2 from the DocBook 4 formatting over to DocBook 5. Included in the post is some of the (PHP and bash) code he used to make the switch.

Within the Zend Framework 2 repository, I recently performed a conversion from DocBook 4 to 5. [...] Interestingly, for DocBook5 being available in beta since 2005 and an official standard since 2009, there is very little material on migrating from DocBook 4 to 5.

Right from the start he came across a few problems with the included conversion process that're a part of the "db4-update.xsl" definitions. He has a list of eight steps he had to perform on the current DocBook 4 formatted documentation to make the conversion work smoothly including:

  • Identify files containing entity declarations, and skip them.
  • Run the XML file through the db4-upgrade.xsl stylesheet and restore XML entities from the previously placed markers
  • Fix programlisting elements (replaces entities with original text and wraps in CDATA).

He details these steps in a few different sections talking about handling the entities, creating some helper scripts and how to put the two code parts together in a single bash script that can be run on the entire documentation set. If you're just looking for the code, you can find it on his github account.

0 comments voice your opinion now!
convert docbook4 docbook5 xsl entities xml bash



Community Events





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


interview symfony library introduction list language podcast laravel framework package series tips update release install community zendserver deployment api opinion

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