2.10 Migration Guide
CakePHP 2.10 is a fully API compatible upgrade from 2.9. This page outlines the changes and improvements made in 2.10.
Console
- Using undefined CLI options will now result in an error. This behavior has been backported from 3.x
Core
- The
CONFIG
constant was added. This constant defaults toapp/Config
, and is intended to increase forwards compatibility with 3.x
Model
- New internal data types were added for
smallinteger
andtinyinteger
. ExistingSMALLINT
andTINYINT
columns will now be reflected as these new internal data types.TINYINT(1)
columns will continue to be treated as boolean columns in MySQL. Model::find()
now supportshaving
andlock
options that enable you to addHAVING
andFOR UPDATE
locking clauses to your find operations.TranslateBehavior
now supports loading translations with LEFT JOIN. Use thejoinType
option to use this feature.
Components
SecurityComponent
now emits more verbose error messages when form tampering or CSRF protection fails in debug mode. This feature was backported from 3.xSecurityComponent
will blackhole post requests that have no request data now. This change helps protect actions that create records using database defaults alone.FlashComponent
now stacks messages of the same type. This is a feature backport from 3.x. To disable this behavior, add'clear' => true
to the configuration for FlashComponent.PaginatorComponent
now supports multiple paginators through thequeryScope
option. Using this option when paginating data will force PaginatorComponent to read from scoped query parameters instead of the root query string data.
Helpers
HtmlHelper::image()
now supports thebase64
option. This option will read local image files and create base64 data URIs.HtmlHelper::addCrumb()
had theprepend
option added. This lets you prepend a breadcrumb instead of appending to the list.FormHelper
creates 'numeric' inputs forsmallinteger
andtinyinteger
types.
Routing
Router::reverseToArray()
was added.