Created
August 18, 2020 13:52
-
-
Save sankalpshekhar/c35dbd0f4e15fa2bfc0ca5136395a020 to your computer and use it in GitHub Desktop.
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 | |
| error_reporting(E_ALL); | |
| ini_set('display_errors', 1); | |
| require __DIR__ . '/app/bootstrap.php'; | |
| class SandboxApp extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface | |
| { | |
| public function launch() | |
| { | |
| $this->_state->setAreaCode('frontend'); | |
| $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); | |
| $productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection'); | |
| echo '<pre>'; | |
| foreach($productCollection as $product) { | |
| echo $product->getSku() . "\n"; | |
| } | |
| echo '</pre>'; | |
| return $this->_response; | |
| } | |
| public function catchException(\Magento\Framework\App\Bootstrap $bootstrap, \Exception $exception) | |
| { | |
| return false; | |
| } | |
| } | |
| $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); | |
| $app = $bootstrap->createApplication('SandboxApp'); | |
| $bootstrap->run($app); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment