Documentation > Known Issues

Known Issues

Running a CakePHP 1.2 application on PHP4 with Jake renders a fatal error: Fatal error: Cannot redeclare clone()

This issue does not affect CakePHP 1.1. It is the result of a redefinition of the function clone() that both Joomla and CakePHP make. To solve this, go to your cake/basics.php file and around line 42 change the following:

if (version_compare(phpversion(), '5.0') < 0)  {

to:

if (version_compare(phpversion(), '5.0') < 0 && !function_exists('clone'))  {

This issue has been sent to the CakePHP team for resolution:

https://trac.cakephp.org/ticket/2119

When a CakePHP application being run through Jake issues a redirect(), user is taken out of Joomla

CakePHP redirects cannot be caught (simply because there’s no way to catch a header and discard it.) Jake takes care of the links automatically, but it cannot prevent your application from getting out of Jake by using redirect() from a controller. Therefore, if you want to make sure your CakePHP application stays on Jake when it is executed through Jake, you will need to catch the calls to Controller::redirect(). To do so, you can redefine the function redirect() at the AppController level.

Create the file app/app_controller.php in your CakePHP application main directory (if you already have one just add the code to your version), with the following contents:

class AppController extends Controller {
        function redirect($url, $status=null) {
                if (defined('JAKE'))
                {
                        $jake =& Jake::getInstance();   

                        $url = $jake->getUrl($url);
                }   

                return parent::redirect($url, $status);
        }
}

Documentation


Navigate

 

Categories


Can't Miss