cakephp-shim

CakePHP plugin to "shim" functionality up and down for major versions of the framework.

MIT License

Downloads
760.3K
Stars
37
Committers
6
cakephp-shim - 1.5.0

Published by dereuromark over 7 years ago

Improvements

  • autoNullConditionsArray()
  • Session shim behavior

Dropped

  • JsHelper
cakephp-shim - 0.6.0

Published by dereuromark over 7 years ago

Backport enableBeforeRedirect to allow disabling the requestAction() internal pseudo redirect for RequestHandler.

cakephp-shim - Small fix for tests

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.

cakephp-shim - Add strict option for delete()

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]);
cakephp-shim - Add strict option for save()

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:

  • NullableBehavior for better data consistency added.
  • YearType added for Forms and dealing with year only fields.
  • CookieHelper added as convenience wrapper for the View layer.
cakephp-shim - Include JsHelper. Raise PHP to 5.5+

Published by dereuromark almost 8 years ago

PHP 5.5+ is now required.

cakephp-shim - Shim find(list) and proper InflectedRoute

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.

cakephp-shim - Small fixes

Published by dereuromark almost 9 years ago

Better handling of deprecation exceptions mainly.

cakephp-shim - 2.x: Shim warning for deprecated save params

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']]
cakephp-shim - 3.x: More shims

Published by dereuromark almost 9 years ago

  • saveAll() wrapper as convenience method
  • Static Session access during upgrading, useful when you have to migrate a model layer with too much static session access usage
  • Minor bugs fixed
  • Better documentation

Dont forget to take a look at the docs and at https://github.com/dereuromark/cakephp-shim/wiki

cakephp-shim - IN / NOT IN shim pendant for 2.x

Published by dereuromark almost 9 years ago

cakephp-shim - Assert valid controller action names

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.

cakephp-shim - existsById() shim

Published by dereuromark almost 9 years ago

cakephp-shim - Also shim exists() and delete()

Published by dereuromark almost 9 years ago

exists() in 3.x uses array and delete() requires an argument (no $this->id internally).

cakephp-shim - Make sure we get no false positives

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().

cakephp-shim - Add warnAboutOldRouting shim

Published by dereuromark almost 9 years ago

  • Param ext should be _ext in URL arrays
  • Param full_base should be _full in URL arrays

Later 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.

cakephp-shim - Rules return early

Published by dereuromark almost 9 years ago

Prevent a small issue with validation rules shim.

cakephp-shim - Re-add i18n validation message array

Published by dereuromark over 9 years ago

It is now possible again to set up an array for the validation message.

cakephp-shim - CakePHP 2.x: TreeBehavior

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:

  • find('treeList')
  • find('path')
  • find('children')

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.

Package Rankings
Top 2.45% on Packagist.org
Badges
Extracted from project README
CI Coverage Minimum PHP Version Coding Standards