Skip to content

Compatibility with PHP 8.4.1 -> CodeIgniter 4.6.1 upgrade #90

@msdevweb

Description

@msdevweb

Current version is not compatible with PHP 8.4.x. It requires CodeIgniter 4.6.1, so the current app CodeIgniter framworks needs to be updated.

Several issues like (but not limited to)
Response: 500 Internal Server Error

Fatal error: Declaration of CodeIgniter\I18n\TimeTrait::createFromTimestamp(int $timestamp, $timezone = null, ?string $locale = null) must be compatible with DateTimeImmutable::createFromTimestamp(int|float $timestamp): CodeIgniter\Autoloader\Autoloader in /www/jobe/system/I18n/TimeTrait.php on line 266



Fatal error: Uncaught Error: Class "CodeIgniter\I18n\Time" not found in /www/moodle/jobe/system/HTTP/ResponseTrait.php:468
Stack trace:
#0 /www/jobe/system/HTTP/ResponseTrait.php(446): CodeIgniter\HTTP\Response->sendHeaders()
#1 /www/jobe/system/Debug/ExceptionHandler.php(81): CodeIgniter\HTTP\Response->send()
#2 /www/jobe/system/Debug/Exceptions.php(156): CodeIgniter\Debug\ExceptionHandler->handle()
#3 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler()
#4 {main}
thrown in /www/jobe/system/HTTP/ResponseTrait.php on line 468

--

Temporary fix/patch, replace function signature in system/I18n/TimeTrait.php:

public static function createFromTimestamp(int $timestamp, $timezone = null, ?string $locale = null)
with:
public static function createFromTimestamp(int|float $timestamp, $timezone = null, ?string $locale = null)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions