Upgrading from 4.1.1 to 4.1.2
Please refer to the upgrade instructions corresponding to your installation method.
Due to a bug in
the resulting URIs could be incorrect for a project’s configuration, most importantly:
would not be included. Projects using
App::$indexPage should expect altered values from
current_url() and all its dependencies (including Response Testing, Pager, Form Helper, Pager,
and View Parser). Update your projects accordingly.
Cache handlers had wildly different compatibility for keys. The updated cache drivers now pass all keys through validation, roughly matching PSR-6’s recommendations:
A string of at least one character that uniquely identifies a cached item. Implementing libraries MUST support keys consisting of the characters A-Z, a-z, 0-9, _, and . in any order in UTF-8 encoding and a length of up to 64 characters. Implementing libraries MAY support additional characters and encodings or longer lengths, but must support at least that minimum. Libraries are responsible for their own escaping of key strings as appropriate, but MUST be able to return the original unmodified key string. The following characters are reserved for future extensions and MUST NOT be supported by implementing libraries:
Update your projects to remove any invalid cache keys.
BaseConnection::query() method in prior versions was incorrectly returning BaseResult objects
even if the query failed. This method will now return
false for failed queries (or throw an
true) and will return booleans for write-type queries. Review any use
query() method and assess whether the value might be boolean instead of Result object.
For a better idea of what queries are write-type queries, check
and any DBMS-specific override
isWriteType() in the relevant Connection class.
If you have written any classes that implement ConnectionInterface, these must now implement the
isWriteType() method, declared as
public function isWriteType($sql): bool. If your class extends BaseConnection, then that class will provide a basic
method which you might want to override.
CodeIgniter\Test namespace has had significant improvements to help developers with their
own test cases. Most notably test extensions have moved to Traits to make them easier to
pick-and-choose across various test case needs. The
classes have been deprecated and their methods moved to
FeatureTestTrait respectively. Update your test cases to extend the main test case
and use any traits you need. For example:
class MyDatabaseTest extends DatabaseTestCase
public function testBadRow()
class MyDatabaseTest extends CIUnitTestCase
public function testBadRow()
ControllerTester has been superseded by
ControllerTestTrait to standardize
approach and take advantage of the updated response testing (below).
The tools for testing responses have been consolidated and improved. A new
FeatureResponse with a complete
set of methods and properties expected from both those classes. In most cases these changes
will be “behind the scenes” by
FeatureTestCase, but two
changes to be aware of:
$responseproperties are protected and should only be access through their getter methods,
TestResponsedoes not have
setBody()methods, but rather uses the Response methods directly, e.g.:
$body = $result->response()->getBody();
Numerous files in the project space (root, app, public, writable) received updates. Due to these files being outside of the system scope they will not be changed without your intervention. There are some third-party CodeIgniter modules available to assist with merging changes to the project space: Explore on Packagist.
Except in very rare cases for bug fixes, no changes made to files for the project space will break your application. All changes noted here are optional until the next major version, and any mandatory changes will be covered in the sections above.
The following files received significant changes (including deprecations or visual adjustments) and it is recommended that you merge the updated versions with your application:
This is a list of all files in the project space that received changes; many will be simple comments or formatting that have no effect on the runtime: