CakePHP plugin to "shim" functionality up and down for major versions of the framework.
MIT License
Published by dereuromark over 7 years ago
Published by dereuromark over 7 years ago
Backport enableBeforeRedirect
to allow disabling the requestAction() internal pseudo redirect for RequestHandler.
Published by dereuromark over 7 years ago
The Timestamp behavior now just checks for $modifiedField and $createdField in the class, and does no lookup anymore on the schema.
This prevents additional fixtures needed for all relations inside a test case.
Published by dereuromark over 7 years ago
delete() can now be called with 'strict'
option to throw an exception instead of returning false.
This can help to catch silent non-deletes where you would otherwise manually wrap it with exception handling everywhere.
E.g. in a CLI script:
$this->TableName->delete($entityName, ['strict' => true]);
Published by dereuromark almost 8 years ago
save() can now be called with 'strict'
option to throw an exception instead of returning false.
This can help to catch silent non-saves where you would otherwise manually wrap it with exception handling everywhere.
E.g. in a CLI script:
$this->TableName->save($entityName, ['strict' => true]);
Also:
Published by dereuromark almost 8 years ago
PHP 5.5+ is now required.
Published by dereuromark almost 9 years ago
find(list) when upgrading from 2.x can have undesired and silent output so far.
This is shimmed at the moment until a core decision to support the 2.x use case with 1-2 selected fields can be made.
Also an InflectedRoute class functioning as any other 3.x route class has been added.
Better use that one if you want to have camelBacked method names as actions in 3.x and have to use inflected URLs.
Published by dereuromark almost 9 years ago
Better handling of deprecation exceptions mainly.
Published by dereuromark almost 9 years ago
Configure::write('Shim.deprecateSaveParams', true);
can now help finding
$this->save($data, false, ['username'])
which should be
$this->save($data, ['validate' => false, 'fieldList' => ['username']]
Published by dereuromark almost 9 years ago
Dont forget to take a look at the docs and at https://github.com/dereuromark/cakephp-shim/wiki
Published by dereuromark almost 9 years ago
Published by dereuromark almost 9 years ago
Published by dereuromark almost 9 years ago
Using Configure::read('Shim.assertActionNames')
you can assert that all controller actions have been properly migrated to the new camelBacked naming scheme. They must not be underscored anymore for DashedRoute setup.
Published by dereuromark almost 9 years ago
Published by dereuromark almost 9 years ago
exists() in 3.x uses array and delete() requires an argument (no $this->id internally).
Published by dereuromark almost 9 years ago
Some core components still use the now deprecated way.
Those should be excluded from throwing notices.
Also now shims saveField() via saveFieldById().
Published by dereuromark almost 9 years ago
ext
should be _ext
in URL arraysfull_base
should be _full
in URL arraysLater those will be very hard to catch with those millions of lines changed when upgrading to 3.x.
They will also be silently ignored then, so better to adjust them now already.
Published by dereuromark almost 9 years ago
Prevent a small issue with validation rules shim.
Published by dereuromark over 9 years ago
It is now possible again to set up an array for the validation message.
Published by dereuromark over 9 years ago
The TreeBehavior of 3.x has been shimmed.
generateTreeList()
, children()
and getPath()
will not be existent anymore.
You can now use the custom finders of 3.x in your 2.x app:
That includes the options that will now be the 2nd argument instead of a long list of arguments.
Note that the TreeBehavior has still to be loaded for the Model to be able to use those finders.