Re: [PATCH] session_set_save_handler(class)
| From: | Arpad Ray | Date: | Fri, 27 Nov 2009 13:23:27 +0000 |
| Subject: | Re: [PATCH] session_set_save_handler(class) | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-46212@lists.php.net to get a copy of this message | ||
On Fri, Nov 27, 2009 at 11:57 AM, Lukas Kahwe Smith <mls@pooteeweet.org>wrote:
>
> sounds useful. i assume with this i could extend for example the session
> handler that comes with the Memcached extension? could you provide a code
> example of how that would look like?
>
Right, the SessionHandler class represents the current save handler,
whichever it is. Here's a minimal example:
<?php
class MySession extends SessionHandler {
public static function read($id) {
echo "hi!";
return parent::read($id);
}
}
session_set_save_handler('MySession');
session_start();
?>
There's a few more examples in the phpt in the patch.
Regards,
Arpad