From 54a44e3be2cfe64cd00c077ce35d0ee219d9471c Mon Sep 17 00:00:00 2001 From: Bruno Moreira Date: Fri, 11 Sep 2026 21:19:37 -0400 Subject: [PATCH 1/8] fix: Stop calling xml_parser_free() on PHP 8.0 and newer. --- system/libraries/Xmlrpc.php | 11 +++++++++-- system/libraries/Xmlrpcs.php | 10 ++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php index be4e34497c..72596daf00 100644 --- a/system/libraries/Xmlrpc.php +++ b/system/libraries/Xmlrpc.php @@ -1185,10 +1185,17 @@ public function parseResponse($fp) xml_get_current_line_number($parser)); $r = new XML_RPC_Response(0, $this->xmlrpcerr['invalid_return'], $this->xmlrpcstr['invalid_return']); - xml_parser_free($parser); + if (PHP_VERSION_ID < 80000) + { + xml_parser_free($parser); + } return $r; } - xml_parser_free($parser); + + if (PHP_VERSION_ID < 80000) + { + xml_parser_free($parser); + } // Got ourselves some badness, it seems if ($this->xh['isf'] > 1) diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php index 557c9912ba..21ed8ee5bb 100644 --- a/system/libraries/Xmlrpcs.php +++ b/system/libraries/Xmlrpcs.php @@ -261,7 +261,10 @@ public function parseRequest($data = '') sprintf('XML error: %s at line %d', xml_error_string(xml_get_error_code($parser)), xml_get_current_line_number($parser))); - xml_parser_free($parser); + if (PHP_VERSION_ID < 80000) + { + xml_parser_free($parser); + } } elseif ($parser_object->xh['isf']) { @@ -269,7 +272,10 @@ public function parseRequest($data = '') } else { - xml_parser_free($parser); + if (PHP_VERSION_ID < 80000) + { + xml_parser_free($parser); + } $m = new XML_RPC_Message($parser_object->xh['method']); $plist = ''; From 8fb1f0b498ac29b53e401c710988cc94c737dc48 Mon Sep 17 00:00:00 2001 From: Bruno Moreira Date: Fri, 11 Sep 2026 21:30:34 -0400 Subject: [PATCH 2/8] fix: Patch vfsStream's spl_object_hash() call. --- composer.json | 6 +++--- tests/patch-vendor.php | 30 ++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 tests/patch-vendor.php diff --git a/composer.json b/composer.json index 81c3ea5065..bd2f486395 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "description": "Actively maintained CodeIgniter 3 fork with support for PHP 5.4 - PHP 8.5 (and beyond). Fully backward compatible.", + "description": "Actively maintained CodeIgniter 3 fork with support for PHP 5.4 - PHP 8.6 (and beyond). Fully backward compatible.", "name": "pocketarc/codeigniter", "type": "project", "homepage": "https://github.com/pocketarc/codeigniter", @@ -19,10 +19,10 @@ "phpunit --color=always --coverage-text --configuration tests/travis/sqlite.phpunit.xml" ], "post-install-cmd": [ - "sed -i s/name{0}/name[0]/ vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/vfsStream.php" + "@php tests/patch-vendor.php" ], "post-update-cmd": [ - "sed -i s/name{0}/name[0]/ vendor/mikey179/vfsstream/src/main/php/org/bovigo/vfs/vfsStream.php" + "@php tests/patch-vendor.php" ] }, "require-dev": { diff --git a/tests/patch-vendor.php b/tests/patch-vendor.php new file mode 100644 index 0000000000..2e0a1c235f --- /dev/null +++ b/tests/patch-vendor.php @@ -0,0 +1,30 @@ + array( + 'return spl_object_hash($resource);' => 'return function_exists(\'spl_object_id\') ? (string) spl_object_id($resource) : spl_object_hash($resource);', + ), +); + +foreach ($patches as $file => $replacements) +{ + if ( ! is_file($file)) + { + continue; + } + + $contents = file_get_contents($file); + $patched = strtr($contents, $replacements); + + if ($patched !== $contents) + { + file_put_contents($file, $patched); + echo 'Patched '.basename($file)."\n"; + } +} From 70ada55225717555088a96c92a26facc8fd15198 Mon Sep 17 00:00:00 2001 From: Bruno Moreira Date: Fri, 11 Sep 2026 21:35:08 -0400 Subject: [PATCH 3/8] ci: Add PHP 8.6 to the matrix, fix issue causing JIT not to be enabled, drop imagick (unused), and fix the composer cache key. --- .github/workflows/test-phpunit.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/test-phpunit.yml index c4f1605bc5..f102278108 100644 --- a/.github/workflows/test-phpunit.yml +++ b/.github/workflows/test-phpunit.yml @@ -15,10 +15,27 @@ jobs: strategy: fail-fast: false matrix: - php: [ '8.5', '8.4', '8.3', '8.2', '8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4' ] + php: [ '8.6', '8.5', '8.4', '8.3', '8.2', '8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4' ] DB: [ 'pdo/mysql', 'pdo/pgsql', 'pdo/sqlite', 'mysqli', 'pgsql', 'sqlite' ] compiler: [ default ] include: + - php: '8.6' + DB: 'pdo/mysql' + compiler: jit + - php: '8.6' + DB: 'pdo/pgsql' + compiler: jit + - php: '8.6' + DB: 'pdo/sqlite' + compiler: jit + - php: '8.6' + DB: 'mysqli' + compiler: jit + - php: '8.6' + DB: 'pgsql' + compiler: jit + - php: '8.6' + DB: 'sqlite' - php: '8.5' DB: 'pdo/mysql' compiler: jit @@ -161,14 +178,14 @@ jobs: uses: actions/checkout@v4 - name: Override PHP ini values for JIT compiler if: matrix.compiler == 'jit' - run: echo "PHP_INI_VALUES::assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=64M" >> $GITHUB_ENV + run: echo "PHP_INI_VALUES=assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=64M" >> $GITHUB_ENV - name: Install PHP${{ matrix.php }} - DB ${{ matrix.DB }} uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} tools: composer, pecl - extensions: imagick, sqlite3, pgsql, mysqli, pdo, pdo_mysql, pdo_pgsql, pdo_sqlite, mbstring + extensions: sqlite3, pgsql, mysqli, pdo, pdo_mysql, pdo_pgsql, pdo_sqlite, mbstring ini-values: ${{ env.PHP_INI_VALUES }} coverage: xdebug @@ -179,7 +196,7 @@ jobs: uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('composer.json') }} restore-keys: ${{ runner.os }}-composer- - name: Install composer dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader From cda200761d00ac9a5aad3136542bd874056ded8e Mon Sep 17 00:00:00 2001 From: Bruno Moreira Date: Fri, 11 Sep 2026 21:35:34 -0400 Subject: [PATCH 4/8] chore: Bump version to 3.4.5. --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index df1a29491a..a53307b91b 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -56,7 +56,7 @@ * @var string * */ - const CI_VERSION = '3.4.4'; + const CI_VERSION = '3.4.5'; /* * ------------------------------------------------------ From 6ba661f436749a676ff3d4b5b45a73475906b5ed Mon Sep 17 00:00:00 2001 From: Bruno Moreira Date: Fri, 11 Sep 2026 21:35:40 -0400 Subject: [PATCH 5/8] chore: Ignore .phpunit.result.cache. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 323f06468b..7c38fa07eb 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ application/logs/* !application/*/.htaccess composer.lock +.phpunit.result.cache tests/mocks/database/ci_test.sqlite user_guide_src/build/* From e405880f18e11c9316ab8158331d2f6d11d13772 Mon Sep 17 00:00:00 2001 From: Bruno Moreira Date: Fri, 11 Sep 2026 21:35:50 -0400 Subject: [PATCH 6/8] style: Fix missing whitespace. --- system/libraries/Session/PHP8SessionWrapper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Session/PHP8SessionWrapper.php b/system/libraries/Session/PHP8SessionWrapper.php index d117d139a7..b3f53a11dd 100644 --- a/system/libraries/Session/PHP8SessionWrapper.php +++ b/system/libraries/Session/PHP8SessionWrapper.php @@ -88,7 +88,7 @@ public function gc(int $maxlifetime): mixed return $this->driver->gc($maxlifetime); } - public function updateTimestamp(string $id, string$data): bool + public function updateTimestamp(string $id, string $data): bool { return $this->driver->updateTimestamp($id, $data); } From 21eff4d9853edadb3beacb8f2d45473092fbcd8b Mon Sep 17 00:00:00 2001 From: Bruno Moreira Date: Fri, 11 Sep 2026 21:36:00 -0400 Subject: [PATCH 7/8] docs: List PHP 8.6 as supported. --- readme.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/readme.rst b/readme.rst index 5407e33a55..20595e4ce3 100644 --- a/readme.rst +++ b/readme.rst @@ -8,8 +8,8 @@ What is this repository? :target: https://github.com/pocketarc/codeigniter/actions/workflows/test-phpunit.yml :alt: PHPUnit Tests -.. |php| image:: https://img.shields.io/badge/PHP-5.4%20--%208.5-8892BF?logo=php - :alt: PHP 5.4 - 8.5 +.. |php| image:: https://img.shields.io/badge/PHP-5.4%20--%208.6-8892BF?logo=php + :alt: PHP 5.4 - 8.6 .. |version| image:: https://img.shields.io/packagist/v/pocketarc/codeigniter :target: https://packagist.org/packages/pocketarc/codeigniter @@ -26,7 +26,8 @@ This is a fork of CodeIgniter 3, with the goal of keeping it up to date with mod - ✅ PHP 8.2 - ✅ PHP 8.3 - ✅ PHP 8.4 -- ✅ PHP 8.5 (and beyond as they are released) +- ✅ PHP 8.5 +- ✅ PHP 8.6 (and beyond as they are released) The original CodeIgniter 3.x branch is no longer maintained, and has not been updated to work with PHP 8.2, or any newer version. This fork is intended to fill that gap. From bbb1ac17cc96af3dadfb43cd180a0047815cc051 Mon Sep 17 00:00:00 2001 From: Bruno Moreira Date: Fri, 11 Sep 2026 22:10:45 -0400 Subject: [PATCH 8/8] ci: Drop the JIT matrix rows, since they're incompatible with Xdebug. --- .github/workflows/test-phpunit.yml | 130 ----------------------------- 1 file changed, 130 deletions(-) diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/test-phpunit.yml index f102278108..e0a1af3a13 100644 --- a/.github/workflows/test-phpunit.yml +++ b/.github/workflows/test-phpunit.yml @@ -17,139 +17,13 @@ jobs: matrix: php: [ '8.6', '8.5', '8.4', '8.3', '8.2', '8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4' ] DB: [ 'pdo/mysql', 'pdo/pgsql', 'pdo/sqlite', 'mysqli', 'pgsql', 'sqlite' ] - compiler: [ default ] include: - - php: '8.6' - DB: 'pdo/mysql' - compiler: jit - - php: '8.6' - DB: 'pdo/pgsql' - compiler: jit - - php: '8.6' - DB: 'pdo/sqlite' - compiler: jit - - php: '8.6' - DB: 'mysqli' - compiler: jit - - php: '8.6' - DB: 'pgsql' - compiler: jit - - php: '8.6' - DB: 'sqlite' - - php: '8.5' - DB: 'pdo/mysql' - compiler: jit - - php: '8.5' - DB: 'pdo/pgsql' - compiler: jit - - php: '8.5' - DB: 'pdo/sqlite' - compiler: jit - - php: '8.5' - DB: 'mysqli' - compiler: jit - - php: '8.5' - DB: 'pgsql' - compiler: jit - - php: '8.5' - DB: 'sqlite' - - php: '8.4' - DB: 'pdo/mysql' - compiler: jit - - php: '8.4' - DB: 'pdo/pgsql' - compiler: jit - - php: '8.4' - DB: 'pdo/sqlite' - compiler: jit - - php: '8.4' - DB: 'mysqli' - compiler: jit - - php: '8.4' - DB: 'pgsql' - compiler: jit - - php: '8.4' - DB: 'sqlite' - - php: '8.3' - DB: 'pdo/mysql' - compiler: jit - - php: '8.3' - DB: 'pdo/pgsql' - compiler: jit - - php: '8.3' - DB: 'pdo/sqlite' - compiler: jit - - php: '8.3' - DB: 'mysqli' - compiler: jit - - php: '8.3' - DB: 'pgsql' - compiler: jit - - php: '8.3' - DB: 'sqlite' - - php: '8.2' - DB: 'pdo/mysql' - compiler: jit - - php: '8.2' - DB: 'pdo/pgsql' - compiler: jit - - php: '8.2' - DB: 'pdo/sqlite' - compiler: jit - - php: '8.2' - DB: 'mysqli' - compiler: jit - - php: '8.2' - DB: 'pgsql' - compiler: jit - - php: '8.2' - DB: 'sqlite' - compiler: jit - - php: '8.1' - DB: 'pdo/mysql' - compiler: jit - - php: '8.1' - DB: 'pdo/pgsql' - compiler: jit - - php: '8.1' - DB: 'pdo/sqlite' - compiler: jit - - php: '8.1' - DB: 'mysqli' - compiler: jit - - php: '8.1' - DB: 'pgsql' - compiler: jit - - php: '8.1' - DB: 'sqlite' - compiler: jit - - php: '8.0' - DB: 'pdo/mysql' - compiler: jit - - php: '8.0' - DB: 'pdo/pgsql' - compiler: jit - - php: '8.0' - DB: 'pdo/sqlite' - compiler: jit - - php: '8.0' - DB: 'mysqli' - compiler: jit - - php: '8.0' - DB: 'pgsql' - compiler: jit - - php: '8.0' - DB: 'sqlite' - compiler: jit - php: '5.6' DB: 'mysql' - compiler: default - php: '5.5' DB: 'mysql' - compiler: default - php: '5.4' DB: 'mysql' - compiler: default services: postgres: @@ -176,10 +50,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Override PHP ini values for JIT compiler - if: matrix.compiler == 'jit' - run: echo "PHP_INI_VALUES=assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=64M" >> $GITHUB_ENV - - name: Install PHP${{ matrix.php }} - DB ${{ matrix.DB }} uses: shivammathur/setup-php@v2 with: