As part of CO-112, COmanage Registry v0.4 migrated from CakePHP 1.3 to 2.05. The full description of everything that changed in CakePHP 2 is available at http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html. Reading only this COmanage wiki page is not a substitute for reviewing the migration guide in the CakePHP book.
* Denotes a change being made concurrent with the CakePHP 2 migration that is not required by CakePHP 2.
All Files
- Drop
?>
closing tag in .php files* - Switch to docbook style* (See Coding Style Guide)
- Throw exceptions for error handling (rarely – this should only be done when a proper error can't be rendered via
setFlash()
or a REST HTTP return code) - Scope functions and variables (ie:
public $requires_co
) - Joins no longer needs dbo full table name (see various examples, including
UsersController:login
)
Models
- Models need all fields defined in
validate()
for REST API* - Models need
public version
set*
Views
$html
is no longer available, use$this->Html
instead- Use $cur_co to get coid for forms (do not directly examine params submitted by user)*
- When generating a
select
, the format for calling has changed (see any examples in various {{fields.inc}}s) select()
needs manual display of error:$this->Form->isFieldError
fieldsErrorToString
is no longer used- Paginator arguments 1 and 2 swapped
Controllers
- Use
$this->request->is('get')
to determine render form vs process data - Drop
$components
from controllers (now in AppController) - Change
include App.standard_controller
to useUses
instead $this->data
becomes$this->request->data
; don't write to either$this->params
becomes$this->request->params
- Changed params for
checkWriteDependencies
andcheckWriteFollowups
*