Skip to content

Commit

Permalink
Merge pull request #6 from dudzio12/master
Browse files Browse the repository at this point in the history
Rollbar initialization only if config is not empty
  • Loading branch information
danielmorell authored Sep 15, 2023
2 parents 23d1811 + 34dd4d0 commit 5229bc0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Plugin/InitPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

class InitPlugin
{
public function beforeLaunch(\Magento\Framework\AppInterface $subject)
{
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$deploymentConfig = $objectManager->get(\Magento\Framework\App\DeploymentConfig::class);
$rollbarConfig = $deploymentConfig->get('rollbar');
public function beforeLaunch(\Magento\Framework\AppInterface $subject)
{
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$deploymentConfig = $objectManager->get(\Magento\Framework\App\DeploymentConfig::class);
$rollbarConfig = $deploymentConfig->get('rollbar');

\Rollbar\Rollbar::init($rollbarConfig);
}
}
if($rollbarConfig) {
\Rollbar\Rollbar::init($rollbarConfig);
}
}
}

0 comments on commit 5229bc0

Please sign in to comment.