Version 4.1.2
Release Date: May 16, 2021
4.1.2 release of CodeIgniter4
BREAKING:
Fixed a bug in current_url()
that prevented
configurations with an indexPage
from including that value in the return value. Any installations
using App::$indexPage
should expect altered values from current_url()
and all its dependencies
(including Response Testing, Pager, Form Helper, Pager, and View Parser).
Enhancements:
New HTTP classes,
Cookie
andCookieStore
, for abstracting web cookies.New
assertRedirectTo()
assertion available for HTTP tests.New logger handler,
ErrorlogHandler
, that writes toerror_log()
.Entity. Added custom type casting functionality.
New option in routing. The
priority
option lower the priority of specific route processing.The
Autoloader
class can now load files which do not contain PHP classes. The list of non-class files will be listed in the$files
property ofConfig\Autoload
class.
Changes:
Layouts in views now support nested sections.
Response::getCookie
now returns aCookie
instance instead of an array of cookie attributes.Response::getCookies
now returns an array ofCookie
instances instead of array of array of attributes.To eliminate warnings from modern browsers’ consoles, empty samesite values will be defaulted to
Lax
on cookie dispatch.Model::errors() and BaseModel::errors() now always returns array; there was no definition change but the docblock has been updated.
Entity::castAs
has changed behavior. Added new parameter$method
. Type casting has been moved to separate handlers.Entity. Timestamp casting now throws an exception when an invalid value is passed
Entity::castAsJson
uses external cast handlerJsonCast::get
.Entity::mutateDate
uses external cast handlerDatetimeCast::get
.In order for
Config\**
classes to get their respective properties’ values from the.env
, it is now necessary to namespace the property with the name of the class. Previously, the property names are enough but now disallowed because it can get system environment variables, likePATH
.The array helper
_array_search_dot
is now marked for@internal
use. As this is used bydot_array_search
, users should not use_array_search_dot
directly in their code.CacheInterface::getMetaData()
returnsnull
for misses, or an array with at least the “expires” key set to the absolute epoch expiration, ornull
for “never expires”. The File, Memcached, and Wincache Handlers still returnfalse
which will becomenull
in a future release.
Deprecations:
Deprecated
CodeIgniter\View\View::$currentSection
property.Language strings and exceptions on invalid cookie samesite are deprecated for the
CookieException
’s own exception message.Deprecated CodeIgniterEntity in favor of CodeIgniterEntityEntity
Deprecated cookie-related properties of
Response
in order to use theCookie
class.Deprecated cookie-related properties of
Security
in order to use theCookie
class.Deprecated cookie-related properties of
Session
in order to use theCookie
class.Deprecated
Security::isExpired()
to use theCookie
’s internal expires status.Deprecated
CIDatabaseTestCase
to use theDatabaseTestTrait
instead.Deprecated
FeatureTestCase
to use theFeatureTestTrait
instead.Deprecated
ControllerTester
to use theControllerTestTrait
instead.Consolidated and deprecated
ControllerResponse
andFeatureResponse
in favor ofTestResponse
.Deprecated
Time::instance()
, useTime::createFromInstance()
instead (now acceptsDateTimeInterface
).Deprecated
IncomingRequest::removeRelativeDirectory()
, useURI::removeDotSegments()
insteadDeprecated
\API\ResponseTrait::failValidationError
to use\API\ResponseTrait::failValidationErrors
instead
Bugs Fixed:
See the repo’s **CHANGELOG.MD* for a complete list of bugs fixed.*
BaseConnection::query()
now returnsfalse
for failed queries (unlessDBDebug==true
, in which case an exception will be thrown) and returns boolean values for write-type queries as specified in the docs.