Created
October 23, 2017 13:39
-
-
Save adrian-martinez-interactiv4/7686616361c9d4c4b66b3f80f616eeae to your computer and use it in GitHub Desktop.
Test Config Backend Model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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