fix(core): publish in-memory session for CLI SessionAccess#206
Merged
Conversation
ralflang
requested changes
Jul 22, 2026
ralflang
left a comment
Member
There was a problem hiding this comment.
As a consolidated PR I cannot accept this. It's important to fix any CLI breakage but not by making the session mechanism some kind of in memory value bag. The point of session is carrying information and mostly identity and grants between request lifecycles. CLI scripts don't really need this and if they depend on sessions for architecture / DI reasons we should not make this part of our session design but fix it in the consumers.
Member
|
See also #207 I re-worked your design a bit. We don't need to introduce a third state where we did not officially start a session but kind of have one. Horde_Session_Null now behaves like a regular legacy Horde_Session shim and interacts with the modern framework. |
ralflang
force-pushed
the
fix/cli-session-access-before-start
branch
from
July 22, 2026 17:28
18d5b17 to
0b90aff
Compare
…n_Null Also route CLI appInit through session_control none Guard CLI and session_control=none scenarios of the legacy registry against code paths using SessionAccess with no session Co-authored-by: Torben Dannhauer <torben@dannhauer.de>
ralflang
force-pushed
the
fix/cli-session-access-before-start
branch
from
July 22, 2026 17:36
0b90aff to
bffa341
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
SessionAccessor::current()during CLIappInit(e.g.horde-alarms) after the SessionAccess refactor.HordeSessionforsetup(false)without callingsession_start().hasCurrent().Motivation
CLI scripts deliberately skip PHP session files (
Horde_Session::setup(false)). After consumers switched toSessionAccess, that left the accessor empty, so language setup and notification handler attach crashed withLogicException.Changes
SessionLifecycle::publishInMemory()— publish accessor/injector binding; keepisActive()false (no$_SESSIONmirror).Horde_Session::setup(false)callspublishInMemory()when a lifecycle is wired.Horde_Registry_Nlsconfigskips session cache when no current session is published.Test plan
vendor/bin/horde-alarmscompletes (exit 0) on a Horde 6 deploymentSessionLifecycleTest::testPublishInMemory…NlsconfigTestcases without established session