Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save adrian-martinez-interactiv4/7686616361c9d4c4b66b3f80f616eeae to your computer and use it in GitHub Desktop.
Save adrian-martinez-interactiv4/7686616361c9d4c4b66b3f80f616eeae to your computer and use it in GitHub Desktop.
Test Config Backend Model
<?php
use Magento\Framework\App\Area;
use Magento\Framework\App\Config\ScopeConfigInterface;
require __DIR__ . '/app/bootstrap.php';
class TestConfigBackendModelApp extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface
{
/**
* @var ScopeConfigInterface
*/
private $scopeConfig;
public function launch()
{
$this->_state->setAreaCode(Area::AREA_FRONTEND);
$this->_objectManager->configure($this->_configLoader->load(Area::AREA_FRONTEND));
$this->scopeConfig = $this->_objectManager->get(ScopeConfigInterface::class);
$body[] = print_r($this->scopeConfig->getValue('newrelicreporting/general/insights_insert_key'), true);
$this->_response->setBody(implode(PHP_EOL, $body) . PHP_EOL);
//the method must end with this line
return $this->_response;
}
public function catchException(\Magento\Framework\App\Bootstrap $bootstrap, \Exception $exception)
{
return false;
}
}
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication('TestConfigBackendModelApp');
$bootstrap->run($app);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment