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

Mattias Noback:
Backwards compatible bundle releases
September 29, 2014 @ 12:31:09

In his latest post Matthias Noback talks about a problem common to Symfony bundles (and, well, software in general) - dealing with backwards compatibility and breaks that could be introduced with new changes.

With a new bundle release you may want to rename services or parameters, make a service private, change some constructor arguments, change the structure of the bundle configuration, etc. Some of these changes may acually be backwards incompatible changes for the users of that bundle. Luckily, the Symfony DependenyInjection component and Config component both provide you with some options to prevent such backwards compatibility (BC) breaks.

He breaks the post up into a few different kinds of backwards compatibility breaks that could happen and code examples of each:

  • Renaming things
  • Changing visibility
  • Changing values

Each topic also includes methods for preventing issues with older users who maybe aren't using the new features. This includes things like sane default values for new settings, renaming services and creating new extensions for working with new properties.

0 comments voice your opinion now!
symfony bundle backwards compatibility changes prevent rename visibility values

Link: http://php-and-symfony.matthiasnoback.nl/2014/09/backwards-compatible-bundle-releases/

Matthew Turland's Blog:
Renaming a DOMNode in PHP
February 10, 2010 @ 09:16:58

Matthew Turland has a new post to his blog sharing a handy trick if you've ever looked for a way to use the DOM functionality on PHP to rename a certain node in an XML document. Since the node_name is read-only, some trickery is required.

A recent work assignment had me using PHP to pull HTML data into a DOMDocument instance and renaming some elements, such as b to strong or i to em. As it turns out, renaming elements using the DOM extension is rather tedious.

His method isn't so much of an update of what's already there as it is to replicate the attributes and child nodes of the node you're targeting and pus those back into the document with a call to replaceChild on the parent.

0 comments voice your opinion now!
rename dom xml node tutorial



Community Events





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


bugfix api framework voicesoftheelephpant list release introduction podcast series laravel conference community library zendserver tips language interview deployment developer symfony

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