Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_cfg_common
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WCMS
uw_cfg_common
Commits
cd9a9991
Commit
cd9a9991
authored
2 years ago
by
Eric Bremner
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-5605: coding standards
parent
2b6a75eb
No related branches found
No related tags found
1 merge request
!247
Feature/istwcms 5605 ebremner migration clean up
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Commands/UwDrushCommands.php
+28
-4
28 additions, 4 deletions
src/Commands/UwDrushCommands.php
with
28 additions
and
4 deletions
src/Commands/UwDrushCommands.php
+
28
−
4
View file @
cd9a9991
...
@@ -4,6 +4,8 @@ namespace Drupal\uw_cfg_common\Commands;
...
@@ -4,6 +4,8 @@ namespace Drupal\uw_cfg_common\Commands;
use
Drupal\Core\Config\ConfigFactoryInterface
;
use
Drupal\Core\Config\ConfigFactoryInterface
;
use
Drupal\Core\Entity\EntityTypeManagerInterface
;
use
Drupal\Core\Entity\EntityTypeManagerInterface
;
use
Drupal\Core\Extension\ModuleHandler
;
use
Drupal\Core\Extension\ModuleInstaller
;
use
Drupal\uw_cfg_common
\Service\UWMissingBlocks
;
use
Drupal\uw_cfg_common
\Service\UWMissingBlocks
;
use
Drupal\uw_cfg_common
\UwPermissions\UwPermissions
;
use
Drupal\uw_cfg_common
\UwPermissions\UwPermissions
;
use
Drupal\uw_cfg_common
\UwRoles\UwRoles
;
use
Drupal\uw_cfg_common
\UwRoles\UwRoles
;
...
@@ -38,13 +40,35 @@ class UwDrushCommands extends DrushCommands {
...
@@ -38,13 +40,35 @@ class UwDrushCommands extends DrushCommands {
*/
*/
protected
$configFactory
;
protected
$configFactory
;
/**
* Module handler.
*
* @var \Drupal\Core\Extension\ModuleHandler
*/
protected
$moduleHandler
;
/**
* Module installer.
*
* @var \Drupal\Core\Extension\ModuleInstaller
*/
protected
$moduleInstaller
;
/**
/**
* {@inheritDoc}
* {@inheritDoc}
*/
*/
public
function
__construct
(
EntityTypeManagerInterface
$entityTypeManager
,
UWMissingBlocks
$missingBlocks
,
ConfigFactoryInterface
$configFactory
)
{
public
function
__construct
(
EntityTypeManagerInterface
$entityTypeManager
,
UWMissingBlocks
$missingBlocks
,
ConfigFactoryInterface
$configFactory
,
ModuleHandler
$moduleHandler
,
ModuleInstaller
$moduleInstaller
)
{
$this
->
entityTypeManager
=
$entityTypeManager
;
$this
->
entityTypeManager
=
$entityTypeManager
;
$this
->
missingBlocks
=
$missingBlocks
;
$this
->
missingBlocks
=
$missingBlocks
;
$this
->
configFactory
=
$configFactory
;
$this
->
configFactory
=
$configFactory
;
$this
->
moduleHandler
=
$moduleHandler
;
$this
->
moduleInstaller
=
$moduleInstaller
;
}
}
/**
/**
...
@@ -240,7 +264,7 @@ class UwDrushCommands extends DrushCommands {
...
@@ -240,7 +264,7 @@ class UwDrushCommands extends DrushCommands {
$modules
=
[
$modules
=
[
'uw_migrate'
,
'uw_migrate'
,
'webform_migrate'
,
'webform_migrate'
,
'webform_node'
'webform_node'
,
];
];
// Step through each of the modules, ensure that they
// Step through each of the modules, ensure that they
...
@@ -248,10 +272,10 @@ class UwDrushCommands extends DrushCommands {
...
@@ -248,10 +272,10 @@ class UwDrushCommands extends DrushCommands {
foreach
(
$modules
as
$module
)
{
foreach
(
$modules
as
$module
)
{
// If the module is enabled, uninstall it.
// If the module is enabled, uninstall it.
if
(
\Drupal
::
service
(
'
module
_h
andler
'
)
->
moduleExists
(
$module
))
{
if
(
$this
->
module
H
andler
->
moduleExists
(
$module
))
{
// Uninstall the module.
// Uninstall the module.
\Drupal
::
service
(
'
module
_i
nstaller
'
)
->
uninstall
([
$module
]);
$this
->
module
I
nstaller
->
uninstall
([
$module
]);
// Log to the screen.
// Log to the screen.
$this
->
logger
()
->
success
(
'Uninstalled: '
.
$module
);
$this
->
logger
()
->
success
(
'Uninstalled: '
.
$module
);
...
...
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