Skip to content
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

Merged
merged 3 commits into from Jan 13, 2014
Merged

Make Phalcon\Session\AdapterInterface compatible with SessionHandlerInterface #1795

merged 3 commits into from Jan 13, 2014

Conversation

ghost
Copy link

@ghost ghost commented Jan 12, 2014

See #1108

@roman-kulish
Copy link

+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

@roman-kulish
Copy link

... 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.

@ghost
Copy link
Author

ghost commented Jan 13, 2014

The suggestion is to extend Phalcon\Session\AdapterInterface from \SessionHandler

\SessionHandler is not available for PHP 5.3

@roman-kulish
Copy link

@roman-kulish
Copy link

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

@ghost
Copy link
Author

ghost commented Jan 13, 2014

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

@ghost
Copy link
Author

ghost commented Jan 13, 2014

it's easy to provide an interface if it's not available in 5.3

…and this will break backward compatibility with older Phalcon versions :-)

phalcon pushed a commit that referenced this pull request Jan 13, 2014
Make Phalcon\Session\AdapterInterface compatible with SessionHandlerInterface
@phalcon phalcon merged commit a659ac7 into phalcon:1.3.0 Jan 13, 2014
@ghost ghost deleted the issue-1108 branch January 13, 2014 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants