This repository has been archived by the owner on Jan 31, 2020. It is now read-only.
Ensure setting save_path considers save_handler #101
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The fix in #99, while correct, did not address setting the session.save_path for non-files save handlers when the save handler is set via
setOption('save_handler', $value)
. The reason for this was due to the fact thatsetOption()
delegates directly tosetStorageOption()
instead of the relevant class method; the changes in #99 make that method a no-op in the case of a save handler option.What this patch does is two-fold:
setOption()
and has it callsetPhpSaveHandler()
ifsave_handler
is provided as the$option
argument. It then returns on completion. Otherwise, it delegates to the parent.setPhpSaveHandler()
to extract the bulk of the logic to a new method,performSaveHandlerUpdate()
. This new method now returns the save handler name to store.setPhpSaveHandler()
then sets that name as thesave_handler
value in the$options
property before returning.I have added a test to verify this behavior based on an example provided in #98.