I have a Session class that has all my on_session_write, on_session_read etc. methods inside the class. In my constructor function i have it initiate the
session_set_save_handler("on_session_start", "开发者_StackOverflow社区on_session_end",
"on_session_read", "on_session_write",
"on_session_destroy", "on_session_gc");
and also session_start() within this my only problem is the methods need to be called using $this-> because everything is within the class. How do i accomplish this?
It's very simple:
array($this,'methodName');
That's a callback to a method.
array('className','methodName');
That's a callback to a static method.
You can pass array($this, 'methodName')
as an argument. Read more on (dead link)http://php.net/manual/en/language.pseudo-types.php
精彩评论