However, I'm having trouble using it. I have a working 1.3 app that I want to upgrade to the latest version of CakePHP (2.3.5 at this time). I am doing this on a Windows 7 PC running Apache 2.2.
I went to the Cookbook and found the instructions for using the upgrade shell. I followed all of the steps (backing up, copying over the 2.3.5 lib and all it's sub directories to the root, copied the app/Console directory from 2.3.5 to my app directory). Following the examples in the Cookbook I ran:
.\Console\cake upgrade all
There were some errors at the very beginning and warnings during the locations part of the script as follows:
C:\apache22\htdocs\wtcms2x\app>.\Console\cake upgrade allNotice: Undefined index: Error in C:\apache22\htdocs\wtcms2x\lib\Cake\Core\Configure.php on line 99Call Stack:0.0004 57936 1. {main}() C:\apache22\htdocs\wtcms2x\app\Console\cake.php:00.0020 179200 2. ShellDispatcher::run() C:\apache22\htdocs\wtcms2x\app\Console\cake.php:370.0020 179840 3. ShellDispatcher->__construct() C:\apache22\htdocs\wtcms2x\lib\Cake\Console\ShellDispatcher.php:670.0023 181456 4. ShellDispatcher->_initEnvironment() C:\apache22\htdocs\wtcms2x\lib\Cake\Console\ShellDispatcher.php:560.0023 182416 5. ShellDispatcher->_bootstrap() C:\apache22\htdocs\wtcms2x\lib\Cake\Console\ShellDispatcher.php:1000.0042 293104 6. require('C:\apache22\htdocs\wtcms2x\lib\Cake\bootstrap.php') C:\apache22\htdocs\wtcms2x\lib\Cake\Console\ShellDispatcher.php:1300.0129 1040664 7. Configure::bootstrap() C:\apache22\htdocs\wtcms2x\lib\Cake\bootstrap.php:170Notice: Undefined index: Exception in C:\apache22\htdocs\wtcms2x\lib\Cake\Core\Configure.php on line 100Call Stack:0.0004 57936 1. {main}() C:\apache22\htdocs\wtcms2x\app\Console\cake.php:00.0020 179200 2. ShellDispatcher::run() C:\apache22\htdocs\wtcms2x\app\Console\cake.php:370.0020 179840 3. ShellDispatcher->__construct() C:\apache22\htdocs\wtcms2x\lib\Cake\Console\ShellDispatcher.php:670.0023 181456 4. ShellDispatcher->_initEnvironment() C:\apache22\htdocs\wtcms2x\lib\Cake\Console\ShellDispatcher.php:560.0023 182416 5. ShellDispatcher->_bootstrap() C:\apache22\htdocs\wtcms2x\lib\Cake\Console\ShellDispatcher.php:1000.0042 293104 6. require('C:\apache22\htdocs\wtcms2x\lib\Cake\bootstrap.php') C:\apache22\htdocs\wtcms2x\lib\Cake\Console\ShellDispatcher.php:1300.0129 1040664 7. Configure::bootstrap() C:\apache22\htdocs\wtcms2x\lib\Cake\bootstrap.php:170Welcome to CakePHP v2.3.5 Console---------------------------------------------------------------App : appPath: C:\apache22\htdocs\wtcms2x\app\---------------------------------------------------------------Moving config to ConfigMoving views to ViewMoving models to ModelMoving Model\behaviors to Model\BehaviorMoving Model\datasources to Model\DatasourceMoving View\configs to View\ConfigsMoving View\contacts to View\ContactsMoving View\content_blocks to View\ContentBlocksMoving View\elements to View\ElementsMoving View\errors to View\ErrorsMoving View\helpers to View\HelpersMoving View\images to View\ImagesMoving View\layouts to View\LayoutsMoving View\pages to View\PagesMoving View\sitemaps to View\SitemapsMoving View\test_installation to View\TestInstallationMoving View\users to View\UsersMoving C:\apache22\htdocs\wtcms2x\app\app_controller.php to C:\apache22\htdocs\wtcms2x\app\Controller\AppController.phpWarning: rename(C:\apache22\htdocs\wtcms2x\app\app_controller.php,C:\apache22\htdocs\wtcms2x\app\Controller\AppController.php): No such file or directory in C:\apache22\htdocs\wtcms2x\lib\Cake\Console\Command\UpgradeShell.php on line 626
When the script was done there was a dir called Controller (2.x naming) and another one called controllers (1.3 naming). I checked the contents of the dir Controller and all of my controllers were there.
In my routes.php I have the following:
Router::connect('/', array('controller' => 'pages', 'action' => 'index'));
When I attempted to run the app (http://localhost/wtcms) I get an error from CakePHP saying that index() does not exist in PagesController and that I should create app/controllers/pages_controller.php.
This looked like I had a mixture of the 2 environments. I checked to see if app/webroot/index.php had been updated to 2.3.5 and it had not. I went through and replaced all the old index.php and .htaccess files at each levels root, /app. and app/webroot with 2.3.5 versions.
Now when I run the app I get the following errors:
( ! ) Notice: Undefined index: Error inC:\apache22\htdocs\wtcms2x\lib\Cake\Core\Configure.php on line /99/Call Stack# Time Memory Function Location1 0.0014 84744 {main}( ) ..\index.php*:*02 0.0040 195232 include('C:\apache22\htdocs\wtcms2x\lib\Cake\bootstrap.php' ) ..\index.php*:*913 0.0141 942952 Configure::bootstrap( ) ..\bootstrap.php*:*170( ! ) Notice: Undefined index: Exception inC:\apache22\htdocs\wtcms2x\lib\Cake\Core\Configure.php on line /100/Call Stack# Time Memory Function Location1 0.0014 84744 {main}( ) ..\index.php*:*02 0.0040 195232 include('C:\apache22\htdocs\wtcms2x\lib\Cake\bootstrap.php' ) ..\index.php*:*913 0.0141 942952 Configure::bootstrap( ) ..\bootstrap.php*:*170( ! ) Notice: Undefined index: datasource inC:\apache22\htdocs\wtcms2x\lib\Cake\Model\ConnectionManager.php on line/264/Call Stack# Time Memory Function Location1 0.0014 84744 {main}( ) ..\index.php*:*02 0.0464 2471864 Dispatcher->dispatch( ) ..\index.php*:*1093 0.0736 3800288 Dispatcher->_invoke( ) ..\Dispatcher.php*:*1624 0.0815 4091928 Controller->startupProcess( ) ..\Dispatcher.php*:*1845 0.0817 4099880 CakeEventManager->dispatch( ) ..\Controller.php*:*6706 0.0819 4101272 call_user_func <http://www.php.net/call_user_func> ( )..\CakeEventManager.php*:*2487 0.0819 4101464 PagesController->beforeFilter( )..\CakeEventManager.php*:*08 0.1378 5699672 Page->getMenu( ) ..\PagesController.php*:*479 0.1378 5701080 AppModel->get( ) ..\Page.php*:*7110 0.1378 5702016 Model->find( ) ..\AppModel.php*:*3911 0.1385 5716008 Model->getDataSource( ) ..\Model.php*:*269612 0.1385 5716320 Model->setSource( ) ..\Model.php*:*324313 0.1385 5717344 Model->setDataSource( ) ..\Model.php*:*110814 0.1407 5779784 ConnectionManager::getDataSource( ) ..\Model.php*:*322115 0.1413 5785928 ConnectionManager::_getConnectionObject( )..\ConnectionManager.php*:*9316 0.1413 5786504 ConnectionManager::_connectionData( )..\ConnectionManager.php*:*249( ! ) Fatal error: Class 'AppHelper' not found inC:\apache22\htdocs\wtcms2x\lib\Cake\View\Helper\HtmlHelper.php on line /32/Call Stack# Time Memory Function Location1 0.1668 6239336 ErrorHandler::handleException( ) ..\ErrorHandler.php*:*02 0.1713 6372592 ExceptionRenderer->render( ) ..\ErrorHandler.php*:*1233 0.1713 6373224 call_user_func_array<http://www.php.net/call_user_func_array> ( ) ..\ExceptionRenderer.php*:*1764 0.1713 6373416 ExceptionRenderer->_cakeError( )..\ExceptionRenderer.php*:*05 0.1714 6375680 ExceptionRenderer->_outputMessage( )..\ExceptionRenderer.php*:*1986 0.1714 6376368 Controller->render( ) ..\ExceptionRenderer.php*:*2747 0.1784 6750944 View->render( ) ..\Controller.php*:*9488 0.1993 6789648 View->renderLayout( ) ..\View.php*:*4799 0.1997 6792808 View->_render( ) ..\View.php*:*53510 0.1998 6795520 View->_evaluate( ) ..\View.php*:*90911 0.2004 6907496 include('C:\apache22\htdocs\wtcms2x\app\View\layouts\default.ctp' )..\View.php*:*94712 0.2004 6911360 View->__get( ) ..\View.php*:*013 0.2004 6912104 HelperCollection->__isset( ) ..\HelperCollection.php*:*014 0.2004 6912544 HelperCollection->load( ) ..\HelperCollection.php*:*6315 0.2005 6914584 class_exists <http://www.php.net/class_exists> ( )..\HelperCollection.php*:*13016 0.2005 6914864 App::load( ) ..\App.php*:*017 0.2061 7204936 include('C:\apache22\htdocs\wtcms2x\lib\Cake\View\Helper\HtmlHelper.php' )..\App.php*:*562
Notice, the first two Notices are the same as the first errors I got when I ran the upgrade script.
Can anyone help. I'm really stuck here. I figure I must be doing something wrong but I can't figure out what it is. Are there other files that the upgrade shell doesn't replace that I need to replace manually? I have gone through the 2.0 Migration Guide and I didn't see anything there. It doesn't even say that the index.php file in webroot needs to be replaced. Does it?
Thanks,
Ken
-- Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment