NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #5307 most downloaded on Packagist
A CakePHP plugin containing lots of useful and reusable tools
Latest stable
3.14.0
Last release 1 months ago
12 Oct 2026
Release timing varies
gaps range from 1 weeks to 3 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
145 releases · first in 2013
Drag across the ruler to compare, or tap a release to open it.
Removed finfo_close() and curl_close() calls that are deprecated in current PHP. #346
LoginLinkAuthenticator now applies the urlChecker option, which was ignored before. An array loginUrl also matches plugin and prefix when given, and non-string tokens are rejected. The Authentication.CakeRouter checker name is mapped to Authentication.Default. #346CommonComponent::getSafeRedirectUrl() rejects non-string values and URLs with backslashes or control characters. RefererRedirectComponent rejects those and protocol-relative URLs. #346CommonComponent::allowExtensions() accepts requests without an extension when the empty string is in the allowed list. #346ShuntRequestController falls back to the first allowed language key instead of its label. #346Mailer::send() restores the locale when sending throws. FileLog::write() restores the debug and a pre-existing custom log config, also on failure, and no longer fails for plain objects with the trace option. #346Tools\I18n\DateTime, CommonComponent::forceCache() and TokensTable no longer depend on the global HOUR, DAY, WEEK and related constants. #346DateTime::period() ignores leading and trailing whitespace. #343StringBehavior throws an InvalidArgumentException for a filter that is not callable. #343MobileComponent sets the Mobile theme without switching to the Theme view class, which no longer exists. #346finfo_close() and curl_close() calls that are deprecated in current PHP. #346LoginLinkAuthenticator now uses the Authentication plugin's UrlCheckerTrait. Subclasses should check for conflicts with _getUrlChecker(), createUrlChecker() and _checkUrl(). If you set urlChecker, it is enforced from now on.Tools\I18n\DateTime defines protected final DURATION_* constants. Subclasses must not redefine those names.yangqi/htmldom suggestion was removed from composer.json; the plugin has no class that uses it.Full Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.13.2...3.14.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
DateTime::lengthOfTime() / relLengthOfTime(): automatic mode now scales units up through weeks, months and years, capped by a new accuracy option (def
DateTime::lengthOfTime() / relLengthOfTime(): automatic mode now scales units up through weeks, months and years, capped by a new accuracy option (default 2), e.g. 1 Week, 3 Days or 11 Years, 3 Months. relLengthOfTime() computes the difference calendar-exact via DateInterval (months/years respect calendar lengths and leap years) and gains a from option for a custom reference point. Relative unit words are translated with a relative msgctxt for grammatically correct wording (e.g. German dative: Vor 4 Tagen). Singular output fixed (1 Day instead of 1 Days), zero units are skipped. Legacy explicit-format engine kept for BC and extended with Y/M/W/w characters. #338GravatarHelper: add a hashAlgo option (default sha256, md5 supported) so callers can restore Gravatar's pre-2024 MD5 identifier for legacy accounts. Without it, the SHA-256 switch silently changes the generated default avatar (identicon, monsterid, ...) for every account that has no real Gravatar image. Unknown values fall back to sha256 and the option never leaks into the URL or img attributes. #336Full Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.13.1...3.13.2
Restore the entity generic on the Table base class, so IdeHelper-generated Table subclass annotations and entity-typed finder return types resolve und
Table base class, so IdeHelper-generated Table subclass annotations and entity-typed finder return types resolve under PHPStan again (https://github.com/dereuromark/cakephp-tools/pull/334)<4.0.0), so the plugin can no longer be paired with an incompatible authentication version (https://github.com/dereuromark/cakephp-tools/pull/335)Full Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.13.0...3.13.1
Honor camelCase DataPreparation.noTrim config key
Full Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.12.9...3.13.0
Gravatar now uses SHA-256, encryption is idempotent, and pregMatch() no longer splices UTF-8 incorrectly
pregMatch() no longer splices UTF-8 incorrectly (#326)PasswordHasherFactory now resolves app- and plugin-provided password hashers instead of being locked to the Tools plugin prefix, while still keeping the built-in Default hasher safe from being silently shadowed (#328)Full Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.12.8...3.12.9
Stop rendering the title attribute unescaped in FormatHelper::neighbors(). The link options forced escape => false, which in CakePHP HtmlHelper disabl
title attribute unescaped in FormatHelper::neighbors(). The link options forced escape => false, which in CakePHP HtmlHelper disables escaping of both the link text and attribute values, so the title attribute rendered raw from arbitrary DB content (XSS surface). Switched to escapeTitle => false so the icon HTML stays in the link text but attributes escape normally. Regression test covers <script> and &" payloads in title-field values.Tools\Model\Table\Table::_validUrl(). Both ternary branches returned 'HTTP', and the [(200|301|302)] regex used a character class instead of an alternation — so it matched any status line containing one of ( 0 1 2 3 |). Replaced with a hardcoded HTTP/ prefix and real (200|301|302) / (404|999) alternations.<select> no longer carries an inline onchange="window.location.href=this.value" handler — replaced with a data-paginator-navigate attribute and a small delegated change listener at the bottom of the element. The accompanying <script> block carries a CSP nonce sourced from the cspNonce request attribute, so apps with a strict script-src 'self' 'nonce-...' policy can run it; falls back gracefully when no nonce is set. (Inline event handlers are blocked under strict CSP without unsafe-inline / unsafe-hashes, and the nonce directive does not cover them per the CSP spec — removing the attribute entirely is the only portable fix.)__() calls in user-facing strings to __d('tools', ...) so translations resolve through the plugin's own i18n domain instead of leaking into the host app's default domain. Affects four static labels in templates/Admin/Helper/{chars,bitmasks}.php and four dynamic title/icon strings in IconCollection, CommonHelper, and FormatHelper. Also refreshes resources/locales/tools.pot (the previous POT was ~6 years stale); existing language files are left for translators to msgmerge against the new POT.Full Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.12.7...3.12.8
Enforce validity window in TokensTable::useKey(). Previously an unused token stayed redeemable past its configured validity until the garbage collecto
TokensTable::useKey(). Previously an unused token stayed redeemable past its configured validity until the garbage collector ran — a real gap for magic-login, email-verification, and password-reset style flows. useKey() now rejects tokens where created < now - validity unless marked unlimited.TEntity template through Tools\Model\Table\Table so subclasses can type their entity for PHPStan. Requires dereuromark/cakephp-shim 3.8.4+ and CakePHP 5.3.4+.Full Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.12.6...3.12.7
Fix autoPrefixUrl() calling urlExists() with invalid URL when input already has https:// protocol
autoPrefixUrl() calling urlExists() with invalid URL when input already has https:// protocolFull Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.12.5...3.12.6
Add timeout to urlExists() cURL request
Add timeout to urlExists() cURL request (#315)
CURLOPT_TIMEOUT (5s) - total request timeoutCURLOPT_CONNECTTIMEOUT (3s) - connection timeoutCURLOPT_FOLLOWLOCATION with MAXREDIRS (3) - follow redirectscurl_close() - properly clean up handleAdd timeout to remaining HTTP requests (#316)
Utility::urlExists() fallback: 5s stream context timeoutUtility::getHeaderFromUrl(): 5s timeoutMime::getMimeTypeByUrl(): 5s timeoutMessage::_readFile(): 10s timeoutFix autoPrefixUrl() calling urlExists() with invalid URL
https:// are now returned as-ishttp:// are properly upgraded by replacing the prefixhttps://https://example.comThis prevents requests from hanging indefinitely when servers don't respond.
Use ServerRequest::clientIp() instead of env('REMOTE_ADDR') for proper proxy header handling
ServerRequest::clientIp() instead of env('REMOTE_ADDR') for proper proxy header handlingFull Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.12.3...3.12.4
Fix page action URLs to use dasherized format instead of camelCase
scope and onDirty options to SluggedBehaviorFull Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.12.2...3.12.3
Fix CakePHP 5.3.0 behavior method deprecations - https://github.com/dereuromark/cakephp-tools/pull/310
Full Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.12.1...3.12.2
Remove deprecated _execute() method from ContactForm
Note: PHP 8.2+ now.
Full Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.12.0...3.12.1
### Improvements - Adjust for CakePHP 5.3+ Full Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.11.2...3.12.0
Full Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.11.2...3.12.0
Fix up validate(Date)(Time) around before/after.
Full Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.11.1...3.11.2
Replaced hardcoded 'token' with configurable query parameter by @tobse in https://github.com/dereuromark/cakephp-tools/pull/303
Full Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.11.0...3.11.1
Allow Jsonable behavior to store comma separated list in a text field.
Jsonable behavior to store comma separated list in a text field.Full Changelog: https://github.com/dereuromark/cakephp-tools/compare/3.10.3...3.11.0
Allow chained inflections in inflect command.
inflect command.Stringable support for TreeHelper.Fixed Shim DateTimeWidget and dropdown select box date support.
### Fixes - Fixed skipLog being applied - Removed deprecations
Added LoginLinkAuthenticator to work with Authentication plugin and allow one time tokens to be used
$service->loadIdentifier('Tools.LoginLink', [
'resolver' => [
'className' => 'Authentication.Orm',
],
]);
// Session, Form, Cookie first
$service->loadAuthenticator('Tools.LoginLink', [
'urlChecker' => 'Authentication.CakeRouter',
'loginUrl' => [
'prefix' => false,
'plugin' => false,
'controller' => 'Account',
'action' => 'login',
],
]);
Then just use Tools.Tokens to generate and send a login link, and once they click it they should auto-login. See docs for details.
### Improvements - Removed deprecations
Fixed CakePHP 5.2 compatibility
Fixed up TimeHelper::nice() to work with Date objects (again).
Added Pages backend to quickly see and follow all available static pages
### Fixes - Fixed DateTime age() - Fixed gender icon BC
Fixed up Date support for TimeHelper::userAge()
TimeHelper::userAge()Allow 2-letter-code language auto-detect based on browser
Fixed upcoming method conflict with log(), so renamed into logException()
Included commits: https://github.com/dereuromark/cakephp-tools/compare/3.6.3...3.6.4
Table::relatedInUse()Included commits: https://github.com/dereuromark/cakephp-tools/compare/3.6.3...3.6.4
### Fixes - Fixed up DateTime difference()
Fixed Sluggable behavior to not modify slug if the entity is not fully hydrated for the label fields.
Allow local skip of trim in CommonComponent (per controller/action)
Added autoLink() / autoLinkUrls() improvements.
Fixed up DateTime output for $this->Time->niceDate()
DateTime output for $this->Time->niceDate()### Improvements - Added Encryption behavior
Added Enum support for Bitmasked behavior
Added Enum support for Bitmasked behavior
use App\Model\Enum\CommentStatus;
$this->Comments->addBehavior('Tools.Bitmasked', [
'bits' => CommentStatus::class,
'mappedField' => 'statuses'],
);
By using an Enum for bits it will automatically switch the incoming and outcoming bit values to Enum instances.
You can also manually set the bits using an array, but then you would have to also set enum to the Enum class:
$this->Comments->addBehavior('Tools.Bitmasked', [
'bits' => CommentStatus::tryFrom(CommentStatus::None->value)::options(),
'enum' => CommentStatus::class,
'mappedField' => 'statuses'],
);
Live demo: https://sandbox.dereuromark.de/sandbox/tools-examples/bitmask-enums
Added EnumOptionsTrait as addon to your enums to have options() method available in your templates etc. It allows also narrowing and re-ordering of yo
Added EnumOptionsTrait as addon to your enums to have options() method available in your templates etc.
It allows also narrowing and re-ordering of your enum options based on the use case.
use App\Model\Enum\UserStatus;
$options = UserStatus::options();
// or for narrowing/re-ordering
$options = UserStatus::options([UserStatus::ACTIVE, UserStatus::INACTIVE]);
echo $this->Form->control('status', ['options' => $options]);
### Fixes Fixed icon usage in templates.
Fixed icon usage in templates.
Fixed icon in template and helper for new Templating plugin support.
Fixed icon in template and helper for new Templating plugin support.
Fixed custom finders to leverage new named params.
Fixed custom finders to leverage new named params.
Note: This has a BC breaking nature, but was necessary to fix up quickly after the 3.0 release.
Number and DateTime classes are now in I18n namespace instead of Utility, following core namespacing.
Main changes:
Enjoy!
Please test, once confirmed we can release stable.
Please test, once confirmed we can release stable.
Allow 2-letter-code language auto-detect based on browser
Fixed missing shims for title attribute
Removed deprecation that was invalid anyways.
Removed deprecation that was invalid anyways.
### Improvements Removed deprecations
Removed deprecations
Add existence check for URL HTTPS detection in detectHttps config
detectHttps configAdded an option to check the existence of Icon::render() icon names instead of silently displaying empty (no) icon.
Added an option to check the existence of Icon::render() icon names instead of silently displaying empty (no) icon.
IconHelper: Allow global and icon set attributes to get merged in with each render() call.
render() call.Fixed icon name handling for title in Icon::render().
Icon::render().Added IconHelper::render() as way to display font icons now, deprecating FormatHelper::icon(). It now is able to serve the following icons out of the…
Added FrozenTime::formatLocalized() for PHP 8.1+ safe localized output of date(time) values.
Added IconHelper::render() as way to display font icons now, deprecating FormatHelper::icon().
It now is able to serve the following icons out of the box and even side-by-side using prefixing (prefix:icon-name):
But based on its DI nature, you can register any Icon class inside and serve any custom or even own icon font this way now. Each Icon class has full control over the rendering of the HTML.
Using IconHelper::names() you can get a list of all font icons available in your PHP code.
Tip: Use IdeHelperExtra plugin to get full autocomplete for the icon names as input for render($name).
Fixed Bitmasked behavior "contain" filtering to work with more than one value. Before it always used the exact combination, whereas an OR of each valu
Fixed Bitmasked behavior "contain" filtering to work with more than one value.
Before it always used the exact combination, whereas an OR of each value is correct for most use cases.
Also added containMode as and if one wants to use exact combination of values to be found.
Live demo of all cases available here: https://sandbox.dereuromark.de/sandbox/tools-examples/bitmask-search
Fixed deprecation changes for validation of array input.
Fixed deprecation changes for validation of array input.
Removed deprecations, specifically Time/Date in favor of immutable ones
Added InvalidArgumentException to 404 detected list of exceptions. Those will be logged separately from the main errors.
Added InvalidArgumentException to 404 detected list of exceptions.
Those will be logged separately from the main errors.
Fixed "edit" font-awesome v5 icon default
Switched to font-awesome v5 icons for the default icons set.
afterMarshalFixed message defaulting for "from" when Config.adminEmail is set.
Fixed message defaulting for "from" when Config.adminEmail is set.
Fixed fullBase for full based URLs.
Fixed fullBase for full based URLs.
One column per quarter.