Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3424701
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3424701
Commits
6e7715a8
Unverified
Commit
6e7715a8
authored
2 months ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3492282
by nicxvan, longwave, catch: Refactor away ModuleInstaller::invokeAll()
parent
86b2f9e2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/lib/Drupal/Core/Extension/ModuleInstaller.php
+4
-19
4 additions, 19 deletions
core/lib/Drupal/Core/Extension/ModuleInstaller.php
with
4 additions
and
19 deletions
core/lib/Drupal/Core/Extension/ModuleInstaller.php
+
4
−
19
View file @
6e7715a8
...
...
@@ -563,7 +563,7 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) {
}
// Allow modules to react prior to the uninstallation of a module.
$this
->
invokeAll
(
'module_preuninstall'
,
[
$module
,
$sync_status
]);
$this
->
moduleHandler
->
invokeAll
(
'module_preuninstall'
,
[
$module
,
$sync_status
]);
// Uninstall the module.
$this
->
moduleHandler
->
loadInclude
(
$module
,
'install'
);
...
...
@@ -657,12 +657,12 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) {
\Drupal
::
service
(
'router.builder'
)
->
rebuild
();
// Let other modules react.
$this
->
invokeAll
(
'modules_uninstalled'
,
[
$module_list
,
$sync_status
]);
$this
->
moduleHandler
->
invokeAll
(
'modules_uninstalled'
,
[
$module_list
,
$sync_status
]);
// Flush all persistent caches.
// Any cache entry might implicitly depend on the uninstalled modules,
// so clear all of them explicitly.
$this
->
invokeAll
(
'cache_flush'
);
$this
->
moduleHandler
->
invokeAll
(
'cache_flush'
);
foreach
(
Cache
::
getBins
()
as
$cache_backend
)
{
$cache_backend
->
deleteAll
();
}
...
...
@@ -799,7 +799,7 @@ protected function uninstallSchema(string $module): void {
}
/**
* Call procedural hook
s
in a
ll
installed module
s
during installation.
* Call
a
procedural hook in a
n
installed module during installation.
*
* Hooks called during install will remain procedural.
* - hook_install()
...
...
@@ -811,21 +811,6 @@ protected function uninstallSchema(string $module): void {
* - hook_update_last_removed()
* - hook_update_N()
*
* @param string $hook
* The name of the hook to invoke.
* @param array $args
* Arguments to pass to the hook.
*/
protected
function
invokeAll
(
$hook
,
$args
=
[]):
void
{
$this
->
moduleHandler
->
loadAll
();
$this
->
moduleHandler
->
invokeAll
(
$hook
,
$args
);
}
/**
* Call a procedural hook in an installed module during installation.
*
* Hook_install(), hook_uninstall() etc. will remain procedural.
*
* @param string $module
* The module (it can be a profile, too).
* @param string $hook
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment