A couple of ideas
- For Blanket, adding an URL base would prevent the need to rewrite relative links, which would certainly lighten the load a bit. Also, if this value is carried across to javascript that would mean some semblance of JS support.
In some of my recent projects I’ve been lamenting PHP’s lack of exceptions. I’ve been writing blocks of code which perform three or four operations but have to clad those ops in 15 lines of error checking armour. I’ve encapsulated most of my functionality in objects, so if those objects threw exceptions it would make much more sense. However, it may be possible to fudge a try-catch like system using the
trigger_error
function. A custom error handler could be created that would behave appropriately and clean up and this would be invoked in a similar manner, stepping out of all functions, to a try block. By defining different catcher functions for different scopes, it would be possible to actually do different things when an error comes in. Not that I do that. I always, always just dump the string into a template and push some HTML out of the door.I found this Zend tip on simulating try-catch-throw. It looks a bit in-depth for my purposes and I’m not sure about the first argument for the try_catch function, but it’s a proof of concept and I think I will try deploying this idea in my next project. Possibly with this method of triggering errors employed in some way in the base classes that throw things.