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

[#33324] fix JSessionStorageMemcache and JSessionStorageMemcached #3156

Closed
wants to merge 4 commits into from

Conversation

itbra
Copy link
Contributor

@itbra itbra commented Feb 21, 2014

Fixing issue described in bug #33324, related to session storage classes JSessionStorageMemcache and JSessionStorageMemcached (libraries/joomla/session/storage/memcache(d).php)

There are presently three problems within this class.

  1. Within the constructor an object variable is referenced that hasn't been initialised thus causing en error to be thrown trying to reference an uninitialised variable. So, $_servers is now a private object variable.
  2. Within the constructor the parent class' constructor is called before the object variable $_servers was actually initialised.
  3. The parent class' constructor's job is to call
$this->register($options)

This method is overridden by this class. Within the method the object variable $_servers is referenced for session.save_path population. Without the patch the call for $_servers ends up with no data. With the patch applied, the call receives the populated object variable containing all registered servers.

  1. As it is obviously intended to register more than one server the variable $_servers is an array of arrays. Thus, in register it must be evaluated how many servers are registered and which one to select. I guess this will involve priority flags at some day. Currently there is only one server registered. So we have to reference this entry first before we can read its host:port for assignment. With this patch applied, this session handler is properly loaded and working.

In __construct() moved the parent class construct call below initilation of $_servers.
In register() fixed the missing consideration of $_servers being an array of arrays.
Added a link to a helpful site
Same issue as with memcache.php
@brianteeman
Copy link
Contributor

Closed as per the comment on the tracker

@brianteeman brianteeman closed this Aug 8, 2014
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.

None yet

3 participants