Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jonatanaxe/6463e9ba9e6d848d9934d1f391d82b12 to your computer and use it in GitHub Desktop.

Select an option

Save jonatanaxe/6463e9ba9e6d848d9934d1f391d82b12 to your computer and use it in GitHub Desktop.

Revisions

  1. @missoxd missoxd revised this gist Nov 29, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions magento2-custom-script.php
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    <?php
    use Magento\Framework\App\Bootstrap;

    require __DIR__ . '/app/bootstrap.php';

    $bootstrap = Bootstrap::create(BP, $_SERVER);
    $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
    $objectManager = $bootstrap->getObjectManager();
    $objectManager->get('\Magento\Framework\App\State')->setAreaCode('adminhtml');

  2. @missoxd missoxd created this gist Nov 29, 2018.
    20 changes: 20 additions & 0 deletions magento2-custom-script.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    <?php
    use Magento\Framework\App\Bootstrap;
    require __DIR__ . '/app/bootstrap.php';

    $bootstrap = 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');