Reputation: 110
I've upgraded from 1.3 to 2.1.1, and now I appear to be getting path errors. Is there a good guide to reference regarding what changes need to be made after running the upgrade shell?
I've tried updating the paths for the core to look in 'lib/Cake',
define('CAKE', CORE_PATH . DS.'lib'.DS. 'Cake' . DS);
but then I start getting include errors.
Fatal error: Class 'Configure' not found in C:\inetpub\wwwroot\phpDev\lib\Cake\bootstrap.php on line 143 <<
Core components that are added inside of bootstrap.php via App::uses() fail (even though App.php is required 6 lines above).
require CAKE . 'basics.php';
require CAKE . 'Core' . DS . 'App.php'; // App::uses() should work
require CAKE . 'Error' . DS . 'exceptions.php';
spl_autoload_register(array('App', 'load'));
App::uses('ErrorHandler', 'Error');
App::uses('Configure', 'Core'); //configure is included
App::uses('CakePlugin', 'Core');
App::uses('Cache', 'Cache');
App::uses('Object', 'Core');
App::$bootstrapping = true;
Configure::bootstrap(isset($boot) ? $boot : true); //this fails (line 143)
I'm thinking I am missing something because bootstrap, Configure.php, App.php, and core.php references should be an all or nothing fix once I get the core path straight. Any insight would be greatly appreciated.
*** UPDATE ****
After doing more research to see if others had encountered, I was hopeful that it was a cache issue. Cleared persistent cache files but not cache...
After several iterations of requiring the files that were failing to be made available by App::uses(), my lib/Cake/bootstrap.php code looks like this
require CAKE . 'basics.php';
require CAKE . 'Core' . DS . 'App.php';
require CAKE . 'Core' . DS . 'Object.php';
require CAKE . 'Error' . DS . 'exceptions.php';
require CAKE . 'Error' . DS . 'ErrorHandler.php';
require CAKE . 'Error' . DS . 'ErrorHandler.php';
require CAKE . 'Core' . DS . 'Configure.php';
require CAKE . 'Core' . DS . 'CakePlugin.php';
require CAKE . 'Cache' . DS . 'Cache.php';
require CAKE . 'Routing' . DS . 'Dispatcher.php';
require CAKE . 'Utility' . DS . 'Debugger.php';
require CAKE . 'Utility' . DS . 'Set.php';
require CAKE . 'Utility' . DS . 'String.php';
spl_autoload_register(array('App', 'load'));
/*App::uses('ErrorHandler', 'Error');
App::uses('Configure', 'Core');
App::uses('CakePlugin', 'Core');
App::uses('Cache', 'Cache');
App::uses('Object', 'Core');*/
Warning (4096): Argument 1 passed to Dispatcher::dispatch() must be an instance of CakeRequest, none given, called in C:\inetpub\wwwroot\phpDev\app\webroot\index.php on line 84 and defined [CORE\lib\Cake\Routing\Dispatcher.php, line 69]
Warning (4096): Argument 2 passed to Dispatcher::dispatch() must be an instance of CakeResponse, none given, called in C:\inetpub\wwwroot\phpDev\app\webroot\index.php on line 84 and defined [CORE\lib\Cake\Routing\Dispatcher.php, line 69]
Notice (8): Undefined variable: request [CORE\lib\Cake\Routing\Dispatcher.php, line 70]
Notice (8): Trying to get property of non-object [CORE\lib\Cake\Routing\Dispatcher.php, line 70]
Notice (8): Undefined variable: response [CORE\lib\Cake\Routing\Dispatcher.php, line 70]
Warning (4096): Argument 2 passed to Dispatcher::asset() must be an instance of CakeResponse, null given, called in C:\inetpub\wwwroot\phpDev\lib\Cake\Routing\Dispatcher.php on line 70 and defined [CORE\lib\Cake\Routing\Dispatcher.php, line 236]
Notice (8): Undefined variable: request [CORE\lib\Cake\Routing\Dispatcher.php, line 70]
Fatal error: Call to a member function here() on a non-object in C:\inetpub\wwwroot\phpDev\lib\Cake\Routing\Dispatcher.php on line 70
So I'm not even getting a cake request object? App::uses() being broken makes no sense either, because I see where it is actually included and that the code is there for the method.
I'm thinking there is something I've overlooked. I'm not very familiar with the core since I've only been a plug and play developer with cake to this point. 1.3 was working like a charm, but I wanted to get upgraded before adding more development. I appreciate all suggestions.
Upvotes: 3
Views: 2676
Reputation: 5893
(Answered in a question edit. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )
The OP wrote:
The upgrade shell did not replace index.php in the app/webroot folder... I knew that the upgrade shell didn't come close to converting the code over to 2.0, but replacing that file was in line with what it actually did. I was surprised to find my old index file, and replacing it was what I needed to get the new framework operational (to the point where cake was at least generating it's own errors!) Thanks for the suggestions and comments.
As a side note, the upgrade shell was successful in renaming the files to match the new naming conventions, but didn't upgrade much of anything else outside of the framework folder.
Upvotes: 0