It is possible to pass methods to session_set_save_handler()?
| From: | Jose Saura | Date: | Wed, 10 May 2000 10:14:23 +0000 |
| Subject: | It is possible to pass methods to session_set_save_handler()? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-11@lists.php.net to get a copy of this message | ||
While trying to encapsulate PHP4 sessions in a class I have found a problem trying to pass
methods instead of pure functions to session_set_save_handler().
This is a sketch of the relevant part of the class:
class Session {
function open() { whatever; }
function close() { whatever; }
....
function Session() { // constructor
/************ Set my own session save handler ************
If the handlers were pure functions the call to set my handlers
would be:
session_set_save_handler("open","close",...);
But they are methods of this class, so what I need is something
like this:
session_set_save_handler("$this->open", "$this->close",..);
Of course it doesn't look like it could work this way.
Is there any solution?
*****************************************************************/
session_set_save_handler("?????","?????",..);
session_start();
}
}
Jose Saura