Skip to content

Phalcon Session Extra Adapters on PHP 8.3.6 #976

Open
@harrywebster

Description

@harrywebster

Installed Phalcon Session Extra Adapters packagist 2.0.0 on PHP 8.3.6 on ubuntu:24.04 using Phalcon 5.8.0 and got the following error message.

Fatal error: Declaration of Phalcon\Incubator\Session\Adapter\Database::gc($maxLifeTime): bool must be compatible with Phalcon\Session\Adapter\AbstractAdapter::gc(int $max_lifetime): int|false in /var/www/vendor/phalcon/incubator-session/src/Adapter/Database.php on line 228

I modified phalcon/incubator-session/src/Adapter/Database.php with following:

<     public function gc($maxLifeTime): bool
---
>     public function gc($maxLifeTime): int | false

example session handler:

use Phalcon\Session\Manager;
use Phalcon\Db\Adapter\Pdo\Mysql;
use Phalcon\Incubator\Session\Adapter\Database;

$di->set('session', function () use ($di) {
	$connection = $di->get('db');
	$session = new Manager();
	$session_dbh = new Database($connection, 'user_session');
	$session->setAdapter($session_dbh);

	session_name('whatever');
	session_write_close();

	$session->start();
	return $session;
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions