Making pre Zend Framework 1.0 applications work

Written by Peter Davies on .

Ok, after following ZF from its infancy I often see fundamental changes every time a new version is released. Now that the release candidate (version 1) has been released, some fundamental changes have been developed. The following PHP code pretty much solves any issues related to converting an older pre v1 RC 1 of the ZF. Its a slight generalisation together with the change in "toArray" in the majority of functions:

 
/* -- set a non-existent error handler + view renderer -- */
$controller->returnResponse(true);
$controller->setParam('useDefaultControllerAlways', true);
$controller->setParam('noErrorHandler', true);
$controller->setParam('noViewRenderer', true);
$response = $controller->dispatch();
 

The idea being that during the next release of any software that uses the above code, you re-engineer the system to cope with errors, and the new view rendering process.