Skip to content

Instantly share code, notes, and snippets.

@bka
Created August 8, 2016 15:32
Show Gist options
  • Save bka/ece3daf7b8d0d4373a98740287621590 to your computer and use it in GitHub Desktop.
Save bka/ece3daf7b8d0d4373a98740287621590 to your computer and use it in GitHub Desktop.
magerun2 dev console objectmanager
$ bin/n98-magerun2.phar dev:console
>>> $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
=> Magento\Framework\ObjectManager\ObjectManager {#15223}
>>> $appState = $objectManager->get("Magento\Framework\App\State")
=> Magento\Framework\App\State {#15471}
>>> $appState->setAreaCode("frontend")
=> null
>>> $a = $objectManager->get('Magento\Catalog\Block\Product\ListProduct')
=> Magento\Catalog\Block\Product\ListProduct\Interceptor {#16073
+"imageBuilder": Magento\Catalog\Block\Product\ImageBuilder {#16069},
+"_cache": Magento\Framework\App\Cache\Proxy {#15275},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment