Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
config_auto_export
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
project
config_auto_export
Commits
3f1f2fa9
There was an error fetching the commit references. Please try again later.
Commit
3f1f2fa9
authored
1 year ago
by
Jürgen Haas
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3393190
by jurgenhaas: Drupal 10 only version
parent
178d26c5
No related branches found
No related tags found
No related merge requests found
Pipeline
#29111
failed
1 year ago
Stage: build
Stage: validate
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drush.services.yml
+0
-12
0 additions, 12 deletions
drush.services.yml
src/Drush/Commands/ConfigAutoExportCommands.php
+42
-12
42 additions, 12 deletions
src/Drush/Commands/ConfigAutoExportCommands.php
with
42 additions
and
24 deletions
drush.services.yml
deleted
100644 → 0
+
0
−
12
View file @
178d26c5
services
:
config_auto_export.commands
:
class
:
Drupal\config_auto_export\Commands\ConfigAutoExportCommands
tags
:
-
{
name
:
drush.command
}
arguments
:
-
'
@config.manager'
-
'
@diff.formatter'
-
'
@config.storage'
-
'
@config_auto_export.storage'
-
'
@config_auto_export.service'
-
'
@renderer'
This diff is collapsed.
Click to expand it.
src/Commands/ConfigAutoExportCommands.php
→
src/
Drush/
Commands/ConfigAutoExportCommands.php
+
42
−
12
View file @
3f1f2fa9
<?php
namespace
Drupal\config_auto_export\Commands
;
namespace
Drupal\config_auto_export\
Drush\
Commands
;
use
Drupal\config_auto_export
\Service
;
use
Drupal\Core\Config\CachedStorage
;
...
...
@@ -9,12 +9,15 @@ use Drupal\Core\Config\FileStorage;
use
Drupal\Core\Diff\DiffFormatter
;
use
Drupal\Core\Render\RendererInterface
;
use
Drupal\Core\StringTranslation\StringTranslationTrait
;
use
Drush\Attributes
as
CLI
;
use
Drush\Commands\DrushCommands
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
* A Drush commandfile.
*/
class
ConfigAutoExportCommands
extends
DrushCommands
{
use
StringTranslationTrait
;
/**
...
...
@@ -75,7 +78,14 @@ class ConfigAutoExportCommands extends DrushCommands {
* @param \Drupal\Core\Render\RendererInterface $renderer
* The interface for the renderer.
*/
public
function
__construct
(
ConfigManagerInterface
$configManager
,
DiffFormatter
$diffFormatter
,
CachedStorage
$cachedStorage
,
FileStorage
$fileStorage
,
Service
$service
,
RendererInterface
$renderer
)
{
public
function
__construct
(
ConfigManagerInterface
$configManager
,
DiffFormatter
$diffFormatter
,
CachedStorage
$cachedStorage
,
FileStorage
$fileStorage
,
Service
$service
,
RendererInterface
$renderer
)
{
parent
::
__construct
();
$this
->
configManager
=
$configManager
;
$this
->
diffFormatter
=
$diffFormatter
;
...
...
@@ -86,10 +96,30 @@ class ConfigAutoExportCommands extends DrushCommands {
}
/**
* Trigger config auto export.
* Return an instance of these Drush commands.
*
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
* The container.
*
* @command cae:trigger
* @return \Drupal\config_auto_export\Drush\Commands\ConfigAutoExportCommands
* The instance of Drush commands.
*/
public
static
function
create
(
ContainerInterface
$container
):
ConfigAutoExportCommands
{
return
new
ConfigAutoExportCommands
(
$container
->
get
(
'config.manager'
),
$container
->
get
(
'diff.formatter'
),
$container
->
get
(
'config.storage'
),
$container
->
get
(
'config_auto_export.storage'
),
$container
->
get
(
'config_auto_export.service'
),
$container
->
get
(
'renderer'
),
);
}
/**
* Trigger config auto export.
*/
#[CLI\Command(name: 'cae:trigger', aliases: [])]
#[CLI\Usage(name: 'cae:trigger', description: 'Trigger config auto export.')]
public
function
trigger
():
void
{
if
(
$this
->
service
->
triggerExport
())
{
$this
->
io
()
->
success
(
'Successfully triggered config export.'
);
...
...
@@ -101,9 +131,9 @@ class ConfigAutoExportCommands extends DrushCommands {
/**
* Get status of config auto export.
*
* @command cae:status
*/
#[CLI\Command(name: 'cae:status', aliases: [])]
#[CLI\Usage(name: 'cae:status', description: 'Get status of config auto export.')]
public
function
status
():
void
{
if
(
$this
->
service
->
isPaused
())
{
$this
->
io
()
->
warning
(
'Config auto export is paused.'
);
...
...
@@ -115,9 +145,9 @@ class ConfigAutoExportCommands extends DrushCommands {
/**
* Pause config auto export.
*
* @command cae:pause
*/
#[CLI\Command(name: 'cae:pause', aliases: [])]
#[CLI\Usage(name: 'cae:pause', description: 'Pause config auto export.')]
public
function
pause
():
void
{
$this
->
service
->
pause
();
$this
->
io
()
->
success
(
'Config auto export paused.'
);
...
...
@@ -125,9 +155,9 @@ class ConfigAutoExportCommands extends DrushCommands {
/**
* Resume config auto export.
*
* @command cae:resume
*/
#[CLI\Command(name: 'cae:resume', aliases: [])]
#[CLI\Usage(name: 'cae:resume', description: 'Resume config auto export.')]
public
function
resume
():
void
{
$this
->
service
->
resume
();
$this
->
io
()
->
success
(
'Config auto export resumed.'
);
...
...
@@ -135,9 +165,9 @@ class ConfigAutoExportCommands extends DrushCommands {
/**
* Re-import config auto export.
*
* @command cae:re-import
*/
#[CLI\Command(name: 'cae:re-import', aliases: [])]
#[CLI\Usage(name: 'cae:re-import', description: 'Re-import config auto export.')]
public
function
reImport
():
void
{
$diffs
=
[];
$this
->
diffFormatter
->
show_header
=
FALSE
;
...
...
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