with the help of How can I bootstrap Magento 2 in a test.php script?
i created files its working fine, but when i try to access admin code it through error "Area code is not Set"
<?php
require dirname(__FILE__) . '/../app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
require dirname(__FILE__) . '/abstract.php';
class Getapp extends AbstractApp
{
public function run()
{
$this->_objectManager->get('Magento\Framework\Registry')
->register('isSecureArea', true);
$datas = $this->_objectManager->create('Magento\ImportExport\Model\ResourceModel\History\Collection');
foreach($datas as $data){
print_r($data->getData()); //.'<br>';
}
}
}
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication('Getapp');
$bootstrap->run($app);
how to access admin level code in magento2