It is possible to pass methods to session_set_save_handler()?
[email protected] (Jose Saura)
| Newsgroups | php.general |
|---|---|
| Message-ID | <[email protected]> |
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