Releases: dereuromark/cakephp-shim
CakePHP 2.x: Adding new shims
Better mobile detection
RequestHandlerComponent backport into 2.x for isMobile() and isTablet() using an up-to-date vendor library.
In order to use that, you will need to composer require "mobiledetect/mobiledetectlib": "2.*"
.
JsonView _jsonOptions
Backport of _jsonOptions support for 2.x as well as setting the 3.x defaults here as well (JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT
).
When upgrading your code to 3.x the output then doesn't change. These 4 flags are recommended to comply to RFC4627.
See the docs for details.
Small BC fix
Conditionally deprecate better to allow people to react in time.
Getting closer to 3.x
- Add assertRedirectContains()
- Deprecate Model::hasAny()
- Add UrlShimHelper for Url::build() and alike
With the last addition you can then use $this->Url->build()
(instead of $this->Html->url()
) already in 2.x.
Using the MyUpgrade shell command cake Upgrade.MyUpgrade shim
you can automate the migration.
Minor fixes
Only disable recursive property with 'Shim.disableRecursive' Configure value set to avoid BC issues.
Also fixed a small session issue.
Added path assertions
Use Configure::write('Shim.checkPaths', true);
to assert that all paths are correctly set up, including a trailing DS
and the correct directory separator (as DS
constant).
Adding Routing Speedup and more wrapper methods
Fixed
- get() typehints
Added
- Routing speedup via precompiled and cached routes.php file.
- record() convenience wrapper.
- Components' and behaviors' convenience wrappers for 3.x.
- primaryKey(), displayField(), alias() and table() wrappers for 3.x.
- Relation on-the-fly setup wrappers via hasOne(), hasMany(), belongsTo(), belongsToMany().
- PHP5.6 builds in test matrix
Minor fixes and improvements
Fixed
- field() shim + deprecation info
Added
- saveField() deprecation info
Add more shims/functionality
Added:
- field() shim
- Named param redirects/handling
- Dedicated ShimException
- SEO duplicate content prevention
Fixed:
- Consistent "contain" / "recursive reset" for all find(), field() and paginate() calls.
Please note:
The Configure namespace has been changed from App
to Shim
.
Make sure you adjust it in your bootstrap/configs.
Test, Model and Helper additions
FormHelper and Html
Some detection shims have been added to find left-overs of the deprecated $confirmMessage param used.
Model
get() has been added to quickly retrieving records in controller actions (backport of 3.x).
IntegrationTestCase
assertResponseSuccess() added for 2xx/3xx range check (backport of 3.x).
IntegrationTestCase additions
Added two convenience methods for IntegrationTestCase:
- assertResponseNotEmpty()
- assertResponseEmpty()