Table of Contents

Migrating Cake from 0.9 to 0.10

Cake 0.9 has another folder structure, which sometimes made it hard to keep up with trunk (changes to be made to your application’s libs folders and so forth). This has all changed in 0.10, and with the new folder structure, the separation between your app and Cake’s internals will be clearer. More help can be found in 0.10_dev_gotchas.

What you need to start:

  • your old app
  • a 0.10.0 Cake release

Where to start

Backups... OK, done? Let’s go.

Moving files

The config/ folder:

Move the config/ files to app/config/.

Move your controllers into app/controllers.

Move your models into app/models.

Move your views into app/views.

Move any extra files you have in /public into app/webroot. Do not overwrite any files you are moving.

If there have been API changes to Views, make them first, then work your way backwards.

Cake Core Changes

First, your controllers need to extend your AppController rather than any helpers they may be extending. For example:

class PaymentsController extends PaymentsHelper

needs to be changed to:

class PaymentsController extends AppController

As such, you’ll need to move your vars out of your helpers and into your main controller. Any helper functions can be follow helpers usage.

Corrections to libs files

Some libs files are moved. This is what the new structure was about, after all:

uses(”dbo/dbo_mysql”, “inflector”);

has become:

uses(”model/dbo/dbo_mysql”, “inflector”);

The vendors folder is also moved:

include_once(”../vendors/dropshadow/class.dropshadow.php”);

has become:

include_once(ROOT.”vendors” .DS.”dropshadow”.DS.”class.dropshadow.php”);

Alternatively, you can use

vendors(’dropshadow.DS.class.dropshadow.php’);

Javascript in vendors/javascript goes to /app/webroot/js/

Yep. I kept some files in vendors/javascript/ - it seemed crazy. The new regime seems fine.

Move all your libs hacks

All your edits to libs files need a new home. Can you move it? Are they really not supported by the framework? Examine the methods, how they’re called, and make your changes accordingly. Some of your libs hacks can perhaps be moved to app_controller.php. Also, think about making components and helpers as this is the preferred method and can be shared more easily with the rest of the community.

more

checkout 0.10_dev_gotchas.

 
tutorials/migration.txt · Last modified: 2005/10/23 14:18