CakePHP plugin to "shim" functionality up and down for major versions of the framework.
MIT License
Published by dereuromark over 9 years ago
With this first release for CakePHP 3.x it is now easier than ever to upgrade existing CakePHP 2.x apps to the next major version.
You might already have shimmed your 2.x project using the corresponding branch of this plugin to ease migration upwards, but even without that you can leverage many of the included shims to make the upgrading process smoother and faster.
The idea:
Shims include
Many more shims are included in the 2.x branch already, so bottom line, if you want to save time and resources:
In case you know you want to upgrade your 2.x app to 3.x, but it will still take a few months, maybe look ahead, use the tips provided (incl. the official migration guide on top) to avoid additional work in the future, use the 2.x Shim plugin versions in your project already and prepare for the upgrade as best as possible.
Happy baking!
Published by dereuromark over 9 years ago
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.*"
.
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.
Published by dereuromark over 9 years ago
Conditionally deprecate better to allow people to react in time.
Published by dereuromark over 9 years ago
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.
Published by dereuromark over 9 years ago
Only disable recursive property with 'Shim.disableRecursive' Configure value set to avoid BC issues.
Also fixed a small session issue.
Published by dereuromark over 9 years ago
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).
Published by dereuromark over 9 years ago
Published by dereuromark over 9 years ago
Published by dereuromark over 9 years ago
The Configure namespace has been changed from App
to Shim
.
Make sure you adjust it in your bootstrap/configs.
Published by dereuromark over 9 years ago
Some detection shims have been added to find left-overs of the deprecated $confirmMessage param used.
get() has been added to quickly retrieving records in controller actions (backport of 3.x).
assertResponseSuccess() added for 2xx/3xx range check (backport of 3.x).
Published by dereuromark over 9 years ago
Added two convenience methods for IntegrationTestCase:
Published by dereuromark over 9 years ago
This plugin is mainly a shim towards 3.x when you are still forced to use 2.x for a while.
It helps the migration process and provides tools to detect and resolve deprecations.
It also addresses some core issues and provides possible fixes or workarounds.