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

Ilia Alshanetsky's Blog:
Big PDO Change
Sep 20, 2005 @ 10:26:36

Today, Ilia Alshanetsky has a new post on his blog with information on a "Big PDO Change".

Today I've had the distinct pleasure of breaking nearly every single PDO based script in existence (my own code included), feels good :-).

The break is the result of something that we, the PDO developers forgot to do. This being making PDO constants be class constants rather the polluting the main constant space. After much discussion on the topic at PHP|Works we've decided we need to fix this before it is too late (5.1 final release). So a bit of a pain at this time, should provide for a more robust and flexible interface.

So, you're asking, does this effect you and your code? And the answer is, well, sort of - if you've used any of the PDO contstants in your code, you'll need to swap "PDO_" with "PDO::".

To simplify the conversion I offer the following Perl scriptlet:
perl -p -i -e 's/PDO_/PDO::/g' [list of files]

tagged:

Link:


Trending Topics: