Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Have the session fire an event after it is started and use this to populate the session with some default objects. #1364

Merged
merged 1 commit into from Aug 21, 2012

Conversation

realityking
Copy link
Contributor

This is an alternative approach to #1349 that doesn't cause JSession to depend on JUser and JRegistry.

@elinw
Copy link
Contributor

elinw commented Jul 15, 2012

I don't know if you have been following the discussions in the other pull requests and on lists but there is really some serious issue with the dependency on JUser. Is what you are going here going to address that?
Most of the links are here #1356 it would be helpful if you would comment there.

P.S. it would be nice to have some tests in general in here http://developer.joomla.org/coverage/joomla_session.html so as not to go from broken one way to broken another way. :)

@realityking
Copy link
Contributor Author

This doesn't address the issue form #1356, it maintains the current way while allowing lazy sessions.

As for unit tests, yes that'd be nice but it's pretty hard because obviously we can't start a session when running the unit tests. (the CLI SAPI might not even have the session methods). We could mock all the PHP methods out and make sure we cll them with he right arguments but that's probably it.

@LouisLandry
Copy link
Contributor

I'm honestly not real excited about having an event triggered there. There are ways we can get some test coverage done for JSession, but not without doing some real thinking about the way it's structured and create wrapper functions around the PHP functions so that they can be replaced with a mock.

@realityking
Copy link
Contributor Author

@LouisLandry
Do you have an alternate suggestion for the event? I was planning to use the same event to move the who's online stuff from JApplication to a plug-in.

@realityking
Copy link
Contributor Author

Updated with some suggestions from Louis.

…pulate the session with some default objects.
LouisLandry added a commit that referenced this pull request Aug 21, 2012
Have the session fire an event after it is started and use this to populate the session with some default objects.
@LouisLandry LouisLandry merged commit bf746b2 into joomla:staging Aug 21, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants