Problem
install_begin_request()is a utter mess.- We are not able to modernize the installer with this code.
Goal
- Replace the minimal container
(s)ininstall_begin_request()with a proper kernel.
Proposed solution
- All of the minimal
ContainerBuilderinstances ininstall_begin_request()are replaced with a single, regularDrupalKernel. - If the base system is not ready to operate yet, then a new
InstallServiceProvideris added to the kernel, which replaces all persistent storage services with memory/null implementations.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | interdiff.txt | 2.53 KB | sun |
| #19 | install.kernel.19.patch | 37.52 KB | sun |
| #11 | interdiff.txt | 7.46 KB | sun |
| #11 | install.kernel.11.patch | 36.53 KB | sun |
| #9 | interdiff.txt | 9.11 KB | sun |
Comments
Comment #1
sunHere we go.
Comment #3
sunFixed last minute cleanup/optimization: theme_handler needs a Routing\MatcherDumper.
Comment #5
dawehnerJust a hint, it uses a route builder not a matcher dumper.
Comment #6
sunComment #7
sunComment #8
sunCreated #2213643: Remove dysfunctional drupal_override_server_variables()
Comment #9
sunComment #11
sunComment #12
sunRemoved obsolete notes about t() from issue summary.
The last patch should come back green again.
Comment #13
dawehner... took it back ...
Comment #14
dawehnerJust wondering whether 'prod' is really the right name. Can't we keep 'install' for semantic reasons?
So we not longer need to use the non-cached version? What was the reason before to need this?
Comment #15
sunThanks for reviewing! :)
Two simple and hopefully satisfying replies:
'prod'is the same environment name as the regular production kernel uses. There is factually no difference between the production kernel booted by the installer and the regular one, so I intentionally want to use the same environment name.module_handlerservice override is obsolete for a very long time already, because the installer replaces thecache.bootstrapservice with a memory backend. This also means that we can and should mergeCachedModuleHandlerintoModuleHandler, but I'm leaving that for a separate issue.FWIW: I was successfully able to combine + leverage this code in #1808220: Remove run-tests.sh dependency on existing/installed parent site
→
run-tests.shis able to operate without first having to install Drupal and enable Simpletest! :-)Comment #16
moshe weitzman commented.
That is awesome!
Comment #17
dawehnerThat patch is good for now
Comment #18
alexpottAre no longer used in install.core.inc
Not used in InstallerServiceProvider.php
This is not true. It makes the dump operation not dump but it does not dump to /dev/null
Can remove
$request_params = \Drupal::request()->request;frominstall_select_language()now.Does not exist and is not used.
Missing leading slash.
Comment #19
sunSince all of these were very minor, I hope it's OK if I move straight back to RTBC.
Comment #20
alexpottNice. Less special installer code++
Committed 45e61d2 and pushed to 8.x. Thanks!
Comment #21
cosmicdreams commentedIn reading this patch, I discovered an exciting @todo. In Drupal\Core\Installer\InstallerRouteBuilder there is a todo that states: "Convert installer steps into routes; add an installer.routing.yml"
Is there already a follow up issue for that?
Comment #22
sunWhile that is indeed exciting, we first want/need to convert all of the trivial procedural code into classes (e.g. all of the forms).
I will create many actionable follow-up issues on which many people will be able to work on in parallel — once they exist, I will link to them in the parent issue #1530756: [meta] Use a proper kernel for the installer, so make sure to follow that. :-)
Comment #23
cosmicdreams commentedGreat news! There's so many awesome things going on with the installer that it's a challenge to stay current / find ways to help. I'll keep at eye on that issue for further information.
Will this work enable being able to hook in custom install steps? Would be kind of nice to kick off a set of Migrate tasks during install for some kinds of projects.
Comment #24
sun@cosmicdreams: Can you create an issue for that? (please search for possibly existing first) It sounds interesting, so I'd like to better understand and discuss what the situation/challenge is. :)
Comment #25
cosmicdreams commentedSure thing. Only thing is, this is functionality we already have in D7. For example take a look at the AbleOrganizer distribution. As a part of it's final install steps it loads sample data into the site in order to demonstrate the system and its reporting capabilities.
My request is to not lose that capability while presenting a DX experience that make it easy to know how to extend the installation process with additional tasks.
And that sounds a lot like what we had with D7. It makes me wonder if I really do need to open a ticket for this. I'm just asking to keep that capability despite the changes to the underlying architecture.
Comment #26
sun@cosmicdreams: Yes, that functionality exists and should still work. But to my knowledge, there are no tests for it, so the best you can do to ensure that it will still work is to create an issue to add test coverage for this apparently undocumented and untested feature ;-)