Release Date: Unreleased
4.7.0 release of CodeIgniter4
- Update minimal PHP requirement to
8.2.
Placeholders in the regex_match validation rule must now use double curly braces.
If you previously used single braces like regex_match[/^{placeholder}$/], you must
update it to use double braces: regex_match[/^{{placeholder}}$/].
This change was introduced to avoid ambiguity with regular expression syntax,
where single curly braces (e.g., {1,3}) are used for quantifiers.
The insertBatch() and updateBatch() methods now honor model settings like
updateOnlyChanged and allowEmptyInserts. This change ensures consistent handling
across all insert/update operations.
- Images: The
ImageHandlerInterfacenow includes a new method:clearMetadata(). If you've implemented your own handler from scratch, you will need to provide an implementation for this method to ensure compatibility.
- Added the
SensitiveParameterattribute to various methods to conceal sensitive information from stack traces. Affected methods are: CodeIgniter\Encryption\EncrypterInterface::encrypt()CodeIgniter\Encryption\EncrypterInterface::decrypt()CodeIgniter\Encryption\Handlers\OpenSSLHandler::encrypt()CodeIgniter\Encryption\Handlers\OpenSSLHandler::decrypt()CodeIgniter\Encryption\Handlers\SodiumHandler::encrypt()CodeIgniter\Encryption\Handlers\SodiumHandler::decrypt()CodeIgniter\HTTP\CURLRequest::setAuth()CodeIgniter\HTTP\URI::setUserInfo()CodeIgniter\Security\Security::derandomize()
- Added the
- Text Helper: The deprecated types in
random_string()function:basic,md5, andsha1has been removed. - BaseModel: The deprecated method
transformDataRowToArray()has been removed. - CodeIgniter: The deprecated
CodeIgniter\CodeIgniter::resolvePlatformExtensions()has been removed.
- API Transformers: This new feature provides a structured way to transform data for API responses. See :ref:`API Transformers <api_transformers>` for details.
- CLI: Added
SignalTraitto provide unified handling of operating system signals in CLI commands. - Cache: Added
asyncandpersistentconfig item to Predis handler. - Cache: Added
persistentconfig item to Redis handler. - CURLRequest: Added
shareConnectionconfig item to change default share connection. - CURLRequest: Added
dns_cache_timeoutoption to change default DNS cache timeout. - CURLRequest: Added
fresh_connectoptions to enable/disable request fresh connection. - DataConverter: Added
EnumCastcaster for database and entity. - Email: Added support for choosing the SMTP authorization method. You can change it via
Config\Email::$SMTPAuthMethodoption. - Image: The
ImageMagickHandlerhas been rewritten to rely solely on the PHPimagickextension. - Image: Added
ImageMagickHandler::clearMetadata()method to remove image metadata for privacy protection. - ResponseTrait: Added
paginate`method to simplify paginated API responses. See :ref:`ResponseTrait::paginate() <api_response_trait_paginate>` for details. - Time: added methods
Time::addCalendarMonths()andTime::subCalendarMonths()
- Exception Logging: All DB drivers now log database exceptions uniformly. Previously, each driver had its own log format.
- MigrationRunner: Added distributed locking support to prevent concurrent migrations in multi-process environments. Enable with
Config\Migrations::$lock = true.
- UserAgents: Expanded the list of recognized
robotswith new search engine and service crawlers.
- Controller Attributes: Added support for PHP Attributes to define filters and other metadata on controller classes and methods. See :ref:`Controller Attributes <incoming/controller_attributes>` for details.
- Added
Email.invalidSMTPAuthMethod,Email.failureSMTPAuthMethod,CLI.signals.noPcntlExtension,CLI.signals.noPosixExtensionandCLI.signals.failedSignal. - Deprecated
Email.failedSMTPLoginandImage.libPathInvalid
- Cookie: The
CookieInterface::EXPIRES_FORMAThas been changed toD, d M Y H:i:s Tto follow the recommended format in RFC 7231. - Format: Added support for configuring
json_encode()maximum depth viaConfig\Format::$jsonEncodeDepth. - Paths: Added support for changing the location of the
.envfile via thePaths::$envDirectoryproperty.
- Image:
- The config property
Config\Image::libraryPathhas been deprecated. No longer used. - The exception method
CodeIgniter\Images\Exceptions\ImageException::forInvalidImageLibraryPathhas been deprecated. No longer used.
- The config property
- Cookie: The
CookieInterface::SAMESITE_STRICT,CookieInterface::SAMESITE_LAX, andCookieInterface::SAMESITE_NONEconstants are now written in ucfirst style to be consistent with usage in the rest of the framework.
See the repo's CHANGELOG.md for a complete list of bugs fixed.