-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Phalcon\Session\AdapterInterface compatible with SessionHandlerInterface #1795
Conversation
+1 All session adapters we have in incubator and distribution have repeated functionality of registering themselves with PHP session handler. Basically they are session handlers and perform operations declared by the SessionHandler interface. The suggestion is to extend Phalcon\Session\AdapterInterface from \SessionHandler. This will expose all interface methods including SessionHandler::destroy() etc and as a side effect Phalcon session will gain ability to auto register adapters as PHP |
... session handlers. Main benefit to this approach is that Seddon handling will happen in a standard way as described in PHP documentation - transparent and understandable. Currently it's confusing, for example how GC is happening? The only possible way is to register proper method via __constructor which is not obvious. |
\SessionHandler is not available for PHP 5.3 |
http://www.php.net/manual/en/class.sessionhandler.php (PHP 5 >= 5.4.0) |
sorry, writing from my phone No drama :) Yep, but 5.3 is a history, also it's easy to provide an interface if it's not available in 5.3 and register its instance methods with the session handler instead of the instance itself as in 5.4 |
This is just what I said: "\SessionHandler is not available for PHP 5.3" :-) Phalcon does support PHP 5.3 and this is why it cannot extend Phalcon\Session\AdapterInterface from \SessionHandler |
…and this will break backward compatibility with older Phalcon versions :-) |
Make Phalcon\Session\AdapterInterface compatible with SessionHandlerInterface
See #1108