Welcome Guest, Not a member yet? Register   Sign In
TypeError when trying to use MemcachedHandler for sessions
#1

I am trying to use MemcachedHandler for my sessions.
I have thus these two lines in Config\Session.php:
PHP Code:
    public string $driver MemcachedHandler::class;
    public string $savePath 'localhost:11211'


I get the following error :

Quote:TypeError

CodeIgniter\Cache\Handlers\MemcachedHandler::__construct(): Argument #1 ($config) must be of type Config\Cache, Config\App given, called in C:\wamp64\www\project\vendor\codeigniter4\framework\system\Config\Services.php on line 667
Reply
#2

PHP Code:
    public string $driver 'CodeIgniter\Session\Handlers\MemcachedHandler'

It is recommended that you learn about PHP's namespacing or how to specify a classname.
Reply
#3

PHP.net - Namespaces overview
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

(04-18-2024, 04:26 PM)kenjis Wrote:
PHP Code:
    public string $driver 'CodeIgniter\Session\Handlers\MemcachedHandler'

It is recommended that you learn about PHP's namespacing or how to specify a classname.

Oh sorry, my fault.
The import generated by PHPStorm was the wrong one and ( I didn't even think to check it (both extend BaseHandler then no warning was triggered).

... which is probably why it's called MemcachedSessionHandler in Symfony.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB