Last active
July 14, 2022 05:03
-
-
Save mrkhoa99/b8648168406cb222f5800e7ec0ebc603 to your computer and use it in GitHub Desktop.
Dirty Playground Magento 2
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
//put under pub/test.php | |
<?php | |
require dirname(__FILE__) . '/../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
//Put under pub/TestApp.php | |
<?php | |
class TestApp extends \Magento\Framework\App\Http | |
implements \Magento\Framework\AppInterface { | |
public function launch() | |
{ | |
//Using object Manager | |
// $object = $this->_objectManager->get('your classs'); | |
echo "Hello World! My Dirty Playground"; | |
return $this->_response; | |
} | |
public function catchException( | |
\Magento\Framework\App\Bootstrap $bootstrap, | |
\Exception $exception | |
) | |
{ | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Open
http://<your_magento_host>/pub/test.php
to see the result.