Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!11070
Add an event subscriber for config export
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Closed
Add an event subscriber for config export
issue/drupal-3463662:3463662-autodetect-executables
into
11.x
Overview
0
Commits
5
Pipelines
7
Changes
8
Closed
Add an event subscriber for config export
Adam G-H
requested to merge
issue/drupal-3463662:3463662-autodetect-executables
into
11.x
6 months ago
Overview
0
Commits
5
Pipelines
7
Changes
8
Closes
#3463662
0
0
Merge request reports
Compare
11.x
version 6
078f5d22
6 months ago
version 5
bd04ab4a
6 months ago
version 4
b5153926
6 months ago
version 3
df0b089b
6 months ago
version 2
cf60f88f
6 months ago
version 1
c086051a
6 months ago
11.x (base)
and
latest version
latest version
9da80720
5 commits,
6 months ago
version 6
078f5d22
5 commits,
6 months ago
version 5
bd04ab4a
4 commits,
6 months ago
version 4
b5153926
4 commits,
6 months ago
version 3
df0b089b
3 commits,
6 months ago
version 2
cf60f88f
2 commits,
6 months ago
version 1
c086051a
1 commit,
6 months ago
8 files
+
202
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
core/modules/package_manager/src/EventSubscriber/ConfigSubscriber.php
0 → 100644
+
47
−
0
View file @ 9da80720
Edit in single-file editor
Open in Web IDE
<?php
declare
(
strict_types
=
1
);
namespace
Drupal\package_manager\EventSubscriber
;
use
Drupal\Core\Config\ConfigEvents
;
use
Drupal\Core\Config\StorageTransformEvent
;
use
Symfony\Component\EventDispatcher\EventSubscriberInterface
;
/**
* Event subscriber to remove executable paths from exported config.
*
* @internal
* This is an internal part of Package Manager and may be changed or removed
* at any time without warning. External code should not interact with this
* class.
*/
final
class
ConfigSubscriber
implements
EventSubscriberInterface
{
/**
* {@inheritdoc}
*/
public
static
function
getSubscribedEvents
():
array
{
return
[
ConfigEvents
::
STORAGE_TRANSFORM_EXPORT
=>
'onExport'
,
];
}
/**
* Removes executable paths from exported config.
*
* @param \Drupal\Core\Config\StorageTransformEvent $event
* The event object.
*/
public
function
onExport
(
StorageTransformEvent
$event
):
void
{
$storage
=
$event
->
getStorage
();
$settings
=
$storage
->
read
(
'package_manager.settings'
);
$settings
[
'executables'
]
=
[
'composer'
=>
NULL
,
'rsync'
=>
NULL
,
];
$storage
->
write
(
'package_manager.settings'
,
$settings
);
}
}
Loading