Created
November 2, 2020 15:26
-
-
Save 0-Sony/79776d6c408d94a27984294838f6deca to your computer and use it in GitHub Desktop.
Magento 2 : Script for Quick Test purpose
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 | |
require __DIR__ . '/app/bootstrap.php'; | |
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); | |
/** @var \Magento\Framework\App\Http $app */ | |
$app = $bootstrap->createApplication('TestApp'); | |
$bootstrap->run($app); |
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\Bootstrap; | |
class TestApp extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface | |
{ | |
public function launch() | |
{ | |
echo 'test'; | |
//the method must end with this line | |
return $this->_response; | |
} | |
/** | |
* @inheritdoc | |
*/ | |
public function catchException(Bootstrap $bootstrap, \Exception $exception): bool | |
{ | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment