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
CONFIGconstant 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
smallintegerandtinyinteger. ExistingSMALLINTandTINYINTcolumns 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 supportshavingandlockoptions that enable you to addHAVINGandFOR UPDATElocking clauses to your find operations.TranslateBehaviornow supports loading translations with LEFT JOIN. Use thejoinTypeoption to use this feature.
Components
SecurityComponentnow emits more verbose error messages when form tampering or CSRF protection fails in debug mode. This feature was backported from 3.xSecurityComponentwill blackhole post requests that have no request data now. This change helps protect actions that create records using database defaults alone.FlashComponentnow stacks messages of the same type. This is a feature backport from 3.x. To disable this behavior, add'clear' => trueto the configuration for FlashComponent.PaginatorComponentnow supports multiple paginators through thequeryScopeoption. 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 thebase64option. This option will read local image files and create base64 data URIs.HtmlHelper::addCrumb()had theprependoption added. This lets you prepend a breadcrumb instead of appending to the list.FormHelpercreates 'numeric' inputs forsmallintegerandtinyintegertypes.
Routing
Router::reverseToArray()was added.