Skip to content

PHP>8.2 compatibility#31

Merged
madwings merged 64 commits into
developfrom
upstream/sync
Apr 27, 2026
Merged

PHP>8.2 compatibility#31
madwings merged 64 commits into
developfrom
upstream/sync

Conversation

@madwings

Copy link
Copy Markdown
Owner

No description provided.

kenjis and others added 30 commits February 12, 2024 09:09
docs: explicitly state that this is for CI3
Signed-off-by: Bruno Moreira <bruno@terraduo.com>
* Adding PHP 8.2 support

* Adds $uri prop in Router, and AllowDynamicProps attribute for CI_Controller

* Adding missing `dest_image` property in CI_Image_lib

---------

Co-authored-by: George Petculescu <gxgpet@gmail.com>
Co-authored-by: George Petculescu <gxgpet@users.noreply.github.com>
Co-authored-by: Roger <roger.r.oliveira@unesp.br>
Due to PHP 8.2 deprecation of dynamic property creation, we can explicitly declare all _compile_* properties in the CI_Profiler class. These properties are known as they are created based on the $_available_sections array. This would be a clearer approach than just using #[AllowDynamicProperties]
timezones() can return either a specific timezone or the whole array.
pocketarc and others added 27 commits December 27, 2025 08:23
…lity. ReflectionMethod/Property::setAccessible() is deprecated in PHP 8.5 and has had no effect since PHP 8.1.
…y. assertObjectHasAttribute() is deprecated in PHPUnit 9.6+. Add assertObjectHasPropertyShim() helper that uses the appropriate method.
Why
- the .webp image type has become common on the internet

What
- modify application/config/mimes.php to include `'webp'  =>	'image/webp'`
* Update DB_query_builder.php

Fix: cast trim() argument to string to prevent null deprecation in PHP 8.x

* Refactor DB_query_builder for array initialization

Updated array initialization and type handling in DB_query_builder.
…ttern with callable arrays [$object, 'method'], which has always been supported.

Closes #18.
…hange. The highlight_string() output format changed in PHP 8.3, not 8.4.
The open() method in Session_redis_driver returns $this->_success even when Redis::connect() fails (the else branch on a failed connection). This causes PHP's session_start() to believe the handler is ready, but subsequent read() calls fail, producing:

session_start(): Failed to read session data: user (path: /var/lib/php/sessions)

This was originally reported and fixed in the upstream bcit-ci/CodeIgniter repo:

Issue: bcit-ci/CodeIgniter#5779
PR: bcit-ci/CodeIgniter#5781
The fix was merged into CI3 for the 3.1.11 milestone but appears to have been lost when the 3.2.0-dev branch was created, which this fork is based on.

The fix changes the failed-connection else branch to log an error and fall through to return $this->_failure instead of incorrectly returning $this->_success.
…ward compatibility).

* fix: restore form_prep() removed in 3.2.0-dev.

* fix: restore do_hash() removed in 3.2.0-dev.

* fix: restore br() and nbs() removed in 3.2.0-dev.

* fix: restore trim_slashes() and repeater() removed in 3.2.0-dev.

* fix: restore standard_date() and nice_date() removed in 3.2.0-dev.

* fix: restore is_cli_request() removed in 3.2.0-dev.

* fix: restore prep_for_form() removed in 3.2.0-dev.

* fix: restore system_url() removed in 3.2.0-dev.

* docs: rework upgrade guide and README for the 3.2+ maintenance fork.

* fix: restore 'unique' and 'encrypt' aliases in random_string() removed in 3.2.0-dev.

* fix: restore 'dash' and 'underscore' aliases in url_title() removed in 3.2.0-dev.

* fix: restore 'anchor_class' option in Pagination removed in 3.2.0-dev.

* fix: restore $_after parameter in add_column() removed in 3.2.0-dev.

* docs: remove restored items from 3.2+ upgrade removal list.

* fix: restore Smiley Helper removed in 3.2.0-dev.

* fix: restore Javascript Library removed in 3.2.0-dev.

* docs: remove restored items from 3.2+ upgrade removal list.
Signed-off-by: Stiliyan Ivanov <stily.c@gmail.com>
Signed-off-by: Stiliyan Ivanov <stily.c@gmail.com>
Signed-off-by: Stiliyan Ivanov <stily.c@gmail.com>
Signed-off-by: Stiliyan Ivanov <stily.c@gmail.com>
Signed-off-by: Stiliyan Ivanov <stily.c@gmail.com>
@madwings madwings changed the title Upstream/sync PHP>8.2 compatibility Apr 27, 2026
@madwings madwings merged commit 96c9aad into develop Apr 27, 2026
70 of 105 checks passed
madwings added a commit that referenced this pull request Apr 27, 2026
* docs: explicitly state that this is for CI3.

* docs: add about CI3

* Fix PHP 8.1 E_DEPRECATED issue when the page has no output.



* Make the PDO driver always throw exceptions on failed queries.

* Make query builder variables accessible to end-user code.

* Add debugbar code back.

* Fix issue with previous commit.

* Merge PHP 8.2 support from gxgpet

* Adding PHP 8.2 support

* Adds $uri prop in Router, and AllowDynamicProps attribute for CI_Controller

* Adding missing `dest_image` property in CI_Image_lib

---------




* Update package name for release in Packagist.

# Conflicts:
#	readme.rst

* Fixes backward incompatibility caused by the upgrade from CI 3.1 to 3.2-dev.

* Fix PHP 8.x compatibility (#5)



* Fixes backward incompatibility caused by the upgrade from CI 3.1 to 3.2-dev.

* Fix deprecated dynamic property creation in CI_Profiler Library.

Due to PHP 8.2 deprecation of dynamic property creation, we can explicitly declare all _compile_* properties in the CI_Profiler class. These properties are known as they are created based on the $_available_sections array. This would be a clearer approach than just using #[AllowDynamicProperties]

* Fix warning and ignored TTL in Redis cache driver.

* Adds compatibility with PHP 8.4.

* Fixes a few more PHP 8.4 compatibility issues.

* Improve timezones() return type.

timezones() can return either a specific timezone or the whole array.

* Fix #28: Fix Postgres DB forge deprecation notice.

* Fix #25: Resolve dynamic property deprecation notice for CI models.

* Fix #27: Clarify installation instructions and update CI_VERSION to fit the new release.

* Fix #24: Fix deprecation notice in db->join().

* Fix #23: Fix deprecation notice in db->order_by().

* Fix #19: Fix PDO Postgres DB forge deprecation notice.

* Fix #16: Add the email helper back to the repo to reduce backward compatibility issues.

* Add wording to the README explaining this is based on CI 3.2.

* Add PHP 8.3/8.4/8.5 to the test matrix in CI.

* Update readme to clarify version support and maintenance policy.

* Fix PHP 8.5 compatibility issue with MySQL driver.

* fix: remove deprecated MYSQLI_TYPE_INTERVAL constant for PHP 8.4+ compatibility.

* fix(upload): add PHP 8.1+ compatibility for finfo_close() deprecation. finfo_open() returns an finfo object (not a resource) since PHP 8.1, which is automatically freed when it goes out of scope.

Fixes #34.

* fix: handle null values in Encryption library for PHP 8.1+ compatibility.

Closes #29.

* Merge gxgpet's XML-RPC fixes.

* Fixes XML-RPC compatibility with PHP 8

* Adds PHPUnit test for XML-RPC lib

---------



* fix(log): restore log_file_extension config for backward compatibility. Restores support for the deprecated $config['log_file_extension'] option that was removed in upstream CI 3.2.0-dev.

Closes #14.

* fix(tests): update highlight_code test for PHP 8.4+ compatibility. PHP 8.4 changed highlight_string() output format from <code><span> with &nbsp; entities to <pre><code> with regular spaces.

* fix: handle null language line key in Lang::line() for PHP 8.5+.

* fix(image): add PHP 8.0+ compatibility for imagedestroy() deprecation. imagedestroy() has been a no-op since PHP 8.0 when GD images changed from resources to GdImage objects with automatic garbage collection.

Closes #35.

* fix(tests): conditionally call setAccessible() for PHP 8.1+ compatibility. ReflectionMethod/Property::setAccessible() is deprecated in PHP 8.5 and has had no effect since PHP 8.1.

* fix(tests): add PHPUnit compatibility shim for assertObjectHasProperty. assertObjectHasAttribute() is deprecated in PHPUnit 9.6+. Add assertObjectHasPropertyShim() helper that uses the appropriate method.

* mimes: add support for webp image type

Why
- the .webp image type has become common on the internet

What
- modify application/config/mimes.php to include `'webp'  =>	'image/webp'`

* Update DB_query_builder.php

* Update DB_query_builder.php

Fix: cast trim() argument to string to prevent null deprecation in PHP 8.x

* Refactor DB_query_builder for array initialization

Updated array initialization and type handling in DB_query_builder.

* fix(xmlrpc): Replace deprecated xml_set_object() + string callback pattern with callable arrays [$object, 'method'], which has always been supported.

Closes #18.

* fix(ci): replace deprecated set-output with $GITHUB_OUTPUT.

* fix(tests): correct PHP version check for highlight_string() format change. The highlight_string() output format changed in PHP 8.3, not 8.4.

* docs: add badges for PHPUnit tests, PHP compatibility, Packagist version, and downloads

* docs: inline images

* docs: update project description for Packagist.

* docs: update project description for Packagist.

* feat: restore Cart library removed in CI 3.2.

* chore: Update version number.

* docs: update upgrade guide and readme to reflect restored functionality for backward compatibility.

* fix: cast ctype_digit() arguments to string to resolve PHP 8.1+ deprecation notice. Fix #41.

* fix: cast mt_rand() arguments to int to resolve PHP 8.1+ deprecation notices in captcha_helper. Fix #40.

* Fix deprecation notice for passing a null to preg_replace (#39)

* fix: add PHPUnit 8.x to composer.json to restore PHP 7.2 test support.

* chore: bump version to 3.4.2.

* Fix Redis session driver returning success on failed connection.

The open() method in Session_redis_driver returns $this->_success even when Redis::connect() fails (the else branch on a failed connection). This causes PHP's session_start() to believe the handler is ready, but subsequent read() calls fail, producing:

session_start(): Failed to read session data: user (path: /var/lib/php/sessions)

This was originally reported and fixed in the upstream bcit-ci/CodeIgniter repo:

Issue: bcit-ci/CodeIgniter#5779
PR: bcit-ci/CodeIgniter#5781
The fix was merged into CI3 for the 3.1.11 milestone but appears to have been lost when the 3.2.0-dev branch was created, which this fork is based on.

The fix changes the failed-connection else branch to log an error and fall through to return $this->_failure instead of incorrectly returning $this->_success.

* Restore deprecated functions that were removed in 3.2.0-dev (for backward compatibility).

* fix: restore form_prep() removed in 3.2.0-dev.

* fix: restore do_hash() removed in 3.2.0-dev.

* fix: restore br() and nbs() removed in 3.2.0-dev.

* fix: restore trim_slashes() and repeater() removed in 3.2.0-dev.

* fix: restore standard_date() and nice_date() removed in 3.2.0-dev.

* fix: restore is_cli_request() removed in 3.2.0-dev.

* fix: restore prep_for_form() removed in 3.2.0-dev.

* fix: restore system_url() removed in 3.2.0-dev.

* docs: rework upgrade guide and README for the 3.2+ maintenance fork.

* fix: restore 'unique' and 'encrypt' aliases in random_string() removed in 3.2.0-dev.

* fix: restore 'dash' and 'underscore' aliases in url_title() removed in 3.2.0-dev.

* fix: restore 'anchor_class' option in Pagination removed in 3.2.0-dev.

* fix: restore $_after parameter in add_column() removed in 3.2.0-dev.

* docs: remove restored items from 3.2+ upgrade removal list.

* fix: restore Smiley Helper removed in 3.2.0-dev.

* fix: restore Javascript Library removed in 3.2.0-dev.

* docs: remove restored items from 3.2+ upgrade removal list.

* Fix workflows



* Fix merge conflicts



* Fix test matrix



* Remove non pdo



---------

Signed-off-by: Bruno Moreira <bruno@terraduo.com>
Signed-off-by: Stiliyan Ivanov <stily.c@gmail.com>
Co-authored-by: kenjis <kenji.uui@gmail.com>
Co-authored-by: Lonnie Ezell <lonnieje@gmail.com>
Co-authored-by: Bruno Moreira <bruno@terraduo.com>
Co-authored-by: George Petculescu <gxgpet@gmail.com>
Co-authored-by: George Petculescu <gxgpet@users.noreply.github.com>
Co-authored-by: Roger <roger.r.oliveira@unesp.br>
Co-authored-by: AJ Dunn <andrewjamesdunn@gmail.com>
Co-authored-by: siemova <5099527+siemova@users.noreply.github.com>
Co-authored-by: Bruno Moreira <git@pocketarc.com>
Co-authored-by: P2GR <Lennartpas@hotmail.com>
Co-authored-by: Bruno Moreira <github@pocketarc.com>
Co-authored-by: RedDragonWebDesign <43397938+RedDragonWebDesign@users.noreply.github.com>
Co-authored-by: Ashraf Kaabi <mail@kaabi.info>
Co-authored-by: Brian Carey <brian@kissitconsulting.com>
Co-authored-by: czirosan <44802400+czirosan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.