Skip to content

Commit 8311086

Browse files
committed
Adds compatibility with PHP 8.4.
1 parent efe7912 commit 8311086

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

index.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@
7373
case 'testing':
7474
case 'production':
7575
ini_set('display_errors', 0);
76-
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
76+
if (version_compare(PHP_VERSION, '8.4', '>=')) {
77+
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
78+
} else {
79+
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
80+
}
7781
break;
7882

7983
default:

readme.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
What is this repository?
33
########################
44

5-
This is a fork of CodeIgniter 3, with the goal of keeping it up to date with PHP 8.3 and beyond. There is no intention to add new features or change the way CI3 works. This is purely a maintenance fork.
5+
This is a fork of CodeIgniter 3, with the goal of keeping it up to date with **PHP 8.4** and beyond. There is no intention to add new features or change the way CI3 works. This is purely a maintenance fork.
66

7-
The original CodeIgniter 3.x branch is no longer maintained, and has not been updated to work with PHP 8.2 (or 8.3). This fork is intended to fill that gap.
7+
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.
88

9-
If the original CodeIgniter 3.x branch is updated to work with PHP 8.3 or newer, and starts to be maintained again, this fork might be retired.
9+
If the original CodeIgniter 3.x branch is updated to work with PHP 8.2+, and starts to be maintained again, this fork might be retired.
1010

1111
****************
1212
Issues and Pulls

system/core/Exceptions.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ class CI_Exceptions {
7373
E_USER_ERROR => 'User Error',
7474
E_USER_WARNING => 'User Warning',
7575
E_USER_NOTICE => 'User Notice',
76-
E_STRICT => 'Runtime Notice'
76+
77+
# 2048 is E_STRICT, but it's deprecated in PHP 8.4.
78+
# We're keeping this here for backwards compatibility.
79+
# If we're on older PHP, E_STRICT errors will be labelled correctly, and if we're on PHP 8.4+, this will be ignored.
80+
2048 => 'Runtime Notice'
7781
);
7882

7983
/**

tests/Bootstrap.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<?php
22
// Errors on full!
33
ini_set('display_errors', 1);
4-
error_reporting(E_ALL | E_STRICT);
4+
5+
if (version_compare(PHP_VERSION, '8.4', '>=')) {
6+
error_reporting(E_ALL);
7+
} else {
8+
error_reporting(E_ALL | E_STRICT);
9+
}
510

611
$dir = realpath(dirname(__FILE__));
712

@@ -80,4 +85,4 @@ class_alias('org\bovigo\vfs\vfsStreamWrapper', 'vfsStreamWrapper');
8085
include_once $dir.'/mocks/autoloader.php';
8186
spl_autoload_register('autoload');
8287

83-
unset($dir);
88+
unset($dir);

0 commit comments

Comments
 (0)