Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
migrate_devel
Commits
7f3daae4
Commit
7f3daae4
authored
Jun 11, 2020
by
andrewmacpherson
Browse files
Issue
#2938677
: Check migrate-debug options in event subscribers, Drush 9 style
parent
3904c3d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
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
(
'
d
ru
sh_get_
option'
)
;
if
(
$using_drush
&&
drush_get_option
(
'migrate-debug'
))
{
if
(
in_array
(
'migrate-debug'
,
\
Drush\Drush
::
config
()
->
get
(
'ru
ntime.
option
s
'
)
))
{
// 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