Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
M
migrate_devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
migrate_devel
Commits
7f3daae4
Commit
7f3daae4
authored
Jun 11, 2020
by
andrewmacpherson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2938677
: Check migrate-debug options in event subscribers, Drush 9 style
parent
3904c3d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
src/EventSubscriber/MigrationEventSubscriber.php
src/EventSubscriber/MigrationEventSubscriber.php
+11
-4
No files found.
src/EventSubscriber/MigrationEventSubscriber.php
View file @
7f3daae4
...
...
@@ -21,10 +21,13 @@ class MigrationEventSubscriber implements EventSubscriberInterface {
* Pre-Row-Save Migrate Event.
*/
public
function
debugRowPreSave
(
MigratePreRowSaveEvent
$event
)
{
if
(
PHP_SAPI
!==
'cli'
)
{
return
;
}
$row
=
$event
->
getRow
();
$using_drush
=
function_exists
(
'drush_get_option'
);
if
(
$using_drush
&&
drush_get_option
(
'migrate-debug-pre'
))
{
if
(
in_array
(
'migrate-debug-pre'
,
\
Drush\Drush
::
config
()
->
get
(
'runtime.options'
)))
{
// Start with capital letter for variables since this is actually a label.
$Source
=
$row
->
getSource
();
$Destination
=
$row
->
getDestination
();
...
...
@@ -42,10 +45,14 @@ class MigrationEventSubscriber implements EventSubscriberInterface {
* Post-Row-Save Migrate Event.
*/
public
function
debugRowPostSave
(
MigratePostRowSaveEvent
$event
)
{
if
(
PHP_SAPI
!==
'cli'
)
{
return
;
}
$row
=
$event
->
getRow
();
$using_drush
=
function_exists
(
'drush_get_option'
);
if
(
$using_drush
&&
drush_get_option
(
'migrate-debug'
))
{
if
(
in_array
(
'migrate-debug'
,
\
Drush\Drush
::
config
()
->
get
(
'runtime.options'
)))
{
// Start with capital letter for variables since this is actually a label.
$Source
=
$row
->
getSource
();
$Destination
=
$row
->
getDestination
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment