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

Play nice when extending Exception
May 30, 2011 @ 14:48:29

Lukas Smith has a suggestion for developers out there who get the idea to start messing with the order of the parameters of PHP objects/methods - play nice. His example is specifically with Exceptions.

This is just a short follow up to a recent tweet of mine. I have seen this repeatedly happen, even to top notch and usually very careful developers (*). I am not sure why this mistake happens so frequently, but quite often you see code that changes the parameter order for custom Exception constructors. I guess it's mostly because in these cases the developer wants to pass some magic parameters that contain the message (and potentially also the code).

He recommends that, if you really do need to change something like the order of the parameters, use something like a factory to handle the reorganization for you.

tagged: extend reorganization factory designpattern

Link:

Matthew Weier O'Phinney's Blog:
ZF Subversion Reorganization
May 23, 2008 @ 14:35:59

If you're using the subversion checkouts of the Zend Framework, Matthew Weier O'Phinney recommends you update your checked out copy to bring it up to sync with the reorganization they've just finished.

We just completed a reorganization of our subversion repository. The reorganization was necessary due to changes we are introducting both in our proposal system as well as project architecture. Specifically, we are introducing a new library, our 'Extras' library, which will contain contributions that are not officially supported by Zend but which still require successful completion of our proposal process. Additionally, we are merging our Laboratory repository.

This page on the Zend Framework website gives the new structure along with a list of key changes and an example of how to switch our your current checkout with this new version.

tagged: zendframework reorganization extras library svn update checkout

Link:


Trending Topics: