php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #60551 session_set_save_handler should support a core's session handler interface
Submitted: 2011-12-17 12:16 UTC Modified: 2012-01-27 22:11 UTC
From: wiltave at gmail dot com Assigned: frozenfire
Status: Closed Package: Session related
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID:
 [2011-12-17 12:16 UTC] wiltave at gmail dot com
Description:
------------
session_set_save_handler expects callbacks to session handler's operations (open, close, etc). It would be great if this function accepts a core's session handler interface. Something like:

<?php
interface Session_Handler_Interface {
    function open();
    function close();
    function read();
    function write();
    function destroy();
    function gc();
}

class Some_Handler implements Session_Handler_Interface {
    // implementations ....
}

$handler = new Some_Handler();
session_set_save_handler($handler);

Then, we'll have an OOP approach too. The old one should not be removed.

Thank you.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-17 18:15 UTC] cataphract@php.net
-Status: Open +Status: Duplicate
 [2011-12-17 18:15 UTC] cataphract@php.net
Already implemented in PHP 5.4.
 [2012-01-04 01:16 UTC] arpad@php.net
Automatic comment from SVN on behalf of arpad
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=321738
Log: add SessionHandlerInterface for session_set_save_handler() - #60551
 [2012-01-04 01:18 UTC] arpad@php.net
-Status: Duplicate +Status: To be documented
 [2012-01-04 01:18 UTC] arpad@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

session_set_save_handler() now takes a SessionHandlerInterface, which SessionHandler implements.
 [2012-01-27 20:08 UTC] frozenfire@php.net
-Status: To be documented +Status: Assigned -Assigned To: +Assigned To: frozenfire
 [2012-01-27 22:08 UTC] frozenfire@php.net
Automatic comment from SVN on behalf of frozenfire
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=322879
Log: Documented SessionHandlerInterface. Closes bug #60551.
 [2012-01-27 22:11 UTC] frozenfire@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 16 04:02:11 2014 UTC