changeDetector = $changeDetector; $this->deploymentConfig = $deploymentConfig; } /** * Performs detects that config data from deployment configuration files been changed. * * @param FrontControllerInterface $subject the interface of frontend controller is wrapped by this plugin * @param RequestInterface $request the object that contains request params * @return void * @throws LocalizedException is thrown if config data from deployment configuration files is not valid * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function beforeDispatch(FrontControllerInterface $subject, RequestInterface $request) { if (!$this->deploymentConfig->get(self::DEPLOYMENT_BLUE_GREEN_ENABLED) && $this->changeDetector->hasChanges() ) { throw new LocalizedException( __( 'The configuration file has changed.' . ' Run the "app:config:import" or the "setup:upgrade" command to synchronize the configuration.' ) ); } } }