Meraj Rasool
Meraj Rasool

Reputation: 751

Upgrading Zend Framework Advise

I am using 'MJS_Controller_PathRouter' in any ancient Zend Framework version 0.6 and PHP 5.1.6. When I run this in a newer php version e.g. 5.2.x or 5.3.x, it is throwing this error:

Declaration of MJS_Controller_Router_PathRoute::__construct() must be compatible with that of Zend_Controller_Router_Route_Interface::__construct() in /opt/ezxwebadmin-versions/ezxwebadmin_2.11.5/Library/MJS/Controller/Router/PathRoute.php on line 34

I would like to remove this enhanced rewrite router and upgrade our application to use a newer Zend Framework version. Our web application doesn't use any of the classes provided by Zend and we are only utilizing the MVC architecture and rewrite functionality from Zend framework.

Now could any one advise which Zend Framework version would be best for us to upgrade to?

Upvotes: 1

Views: 247

Answers (2)

Christopher Manning
Christopher Manning

Reputation: 4557

You should take a close look at the Zend Framework Migration Notes starting at 0.8

Then look through the Zend Framework Download Archives and upgrade your framework version by version (follow the versions listed in the migration notes) to either get to a version that works with the PHP you have or (ideally) the latest version: 1.11.x

Upvotes: 0

Tim Fountain
Tim Fountain

Reputation: 33148

The error you are getting is actually a PHP strict coding standards error and should be fairly easy to fix. Just open up Zend_Controller_Router_Route_Interface and MJS_Controller_Router_PathRoute and compare the parameters for the __construct method. They need to be the same, so change your class to match the parameters in the interface.

Zend Framework requires PHP 5.2.4. ZF2 will require PHP 5.3+. PHP 5.1.6 is almost 5 years old so you really should be upgrading (or planning to). If you are using something like CentOS with really ancient PHP packages, you might want to consider switching to Zend Server community edition (which is free). This can be installed with Yum and will give you more recent versions of PHP.

Upvotes: 1

Related Questions