useFakeSession during install on Standalone #29487
Closed
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.
Use a fake session during Standalone install, because we might not have the real session handler yet (because the extension that provides it hasn't been installed),
Before
Standalone web installer crashes because of trying to start a session during the install, before standaloneusers extension is enabled to provide the session handler.
After
Install completes successfully.
Technical details
I tried @totten 's suggestion here #29362 (comment) but it didn't seem to work. Because the Civi-bootstrap phase forces recreating the
CRM_Core_Config
singleton, the fakeness is lost.I was also keen possible session creation during install by any pesky
CRM_Core_Session::setStatus
calls -- this doesn't work for that case because it's inside the$loadFromDB
case, and at the beginning of the install we're not loading from DB.The alternative that did cover this case is to put a check inside
CRM_Core_Session::singleton
, but this seems quite aggressive. (Ie. #29488 )After all this I'm thinking the initial approach of using default PHP session handler might be the neatest way. For one thing it keeps the Standalone specific code inside
userSystem
, which seems desirable.