Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CheckConfig.php
Go to the documentation of this file.
1 <?php
7 
13 
18 {
22  protected $config;
23 
27  protected $newRelicWrapper;
28 
32  protected $messageManager;
33 
39  public function __construct(
43  ) {
44  $this->config = $config;
45  $this->newRelicWrapper = $newRelicWrapper;
46  $this->messageManager = $messageManager;
47  }
48 
56  public function execute(Observer $observer)
57  {
58  if ($this->config->isNewRelicEnabled()) {
59  if (!$this->newRelicWrapper->isExtensionInstalled()) {
60  $this->config->disableModule();
61  $this->messageManager->addError(
62  __(
63  'The New Relic integration requires the newrelic-php5 agent, which is not installed. More
64  information on installing the agent is available <a target="_blank" href="%1">here</a>.',
65  'https://docs.newrelic.com/docs/agents/php-agent/installation/php-agent-installation-overview'
66  ),
67  $this->messageManager->getDefaultGroup()
68  );
69  }
70  }
71  }
72 }
__()
Definition: __.php:13
__construct(Config $config, NewRelicWrapper $newRelicWrapper, ManagerInterface $messageManager)
Definition: CheckConfig.php:39