Skip to content
Snippets Groups Projects
Commit a5fafcd9 authored by omkar podey's avatar omkar podey Committed by Ted Bowman
Browse files

Issue #3305994 by omkar.podey: We don't want to run the XdebugValidator for...

Issue #3305994 by omkar.podey: We don't want to run the XdebugValidator for non-Automatic Updates stage
parent 4cad03f9
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,7 @@ namespace Drupal\automatic_updates\Validator; ...@@ -4,6 +4,7 @@ namespace Drupal\automatic_updates\Validator;
use Drupal\automatic_updates\CronUpdater; use Drupal\automatic_updates\CronUpdater;
use Drupal\automatic_updates\Event\ReadinessCheckEvent; use Drupal\automatic_updates\Event\ReadinessCheckEvent;
use Drupal\automatic_updates\Updater;
use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\package_manager\Event\PreCreateEvent; use Drupal\package_manager\Event\PreCreateEvent;
use Drupal\package_manager\Event\PreOperationStageEvent; use Drupal\package_manager\Event\PreOperationStageEvent;
...@@ -28,6 +29,11 @@ final class XdebugValidator implements EventSubscriberInterface { ...@@ -28,6 +29,11 @@ final class XdebugValidator implements EventSubscriberInterface {
* The event object. * The event object.
*/ */
public function checkForXdebug(PreOperationStageEvent $event): void { public function checkForXdebug(PreOperationStageEvent $event): void {
// We only want to do this check if the stage belongs to Automatic Updates.
if (!($event->getStage() instanceof Updater)) {
return;
}
if (function_exists('xdebug_break')) { if (function_exists('xdebug_break')) {
$messages = [ $messages = [
$this->t('Xdebug is enabled, which may cause timeout errors.'), $this->t('Xdebug is enabled, which may cause timeout errors.'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment