Last active
June 22, 2020 20:24
-
-
Save missoxd/f5aaa186bb54013c9d4c32d0c62cc194 to your computer and use it in GitHub Desktop.
Magento 2 custom script boilerplate
This file contains 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); | |
$objectManager = $bootstrap->getObjectManager(); | |
$objectManager->get('\Magento\Framework\App\State')->setAreaCode('adminhtml'); | |
$registry = $objectManager->get('\Magento\Framework\Registry'); | |
$registry->register('isSecureArea', 'true'); | |
#################################################################################################### | |
## BEGIN | |
#################################################################################################### | |
## END | |
$registry->unregister('isSecureArea'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment