This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
urapidflow:v3:file_preprocess [2016/11/01 21:20] jamby77 created |
urapidflow:v3:file_preprocess [2017/05/19 19:08] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <file php bootstrap.php> | ||
+ | <?php | ||
+ | // initialize Magento environment | ||
+ | try { | ||
+ | // if you move this file, adjust bootstrap.php path | ||
+ | require __DIR__ . '/ | ||
+ | } catch (\Exception $e) { | ||
+ | echo <<< | ||
+ | {$e-> | ||
+ | </ | ||
+ | HTML; | ||
+ | exit(1); | ||
+ | } | ||
+ | |||
+ | $params = $_SERVER; | ||
+ | $params[\Magento\Store\Model\StoreManager:: | ||
+ | $params[\Magento\Store\Model\Store:: | ||
+ | $bootstrap = \Magento\Framework\App\Bootstrap:: | ||
+ | |||
+ | /** @var \Magento\Framework\App\Http $app */ | ||
+ | $app = $bootstrap-> | ||
+ | |||
+ | // configure environment | ||
+ | $om = $bootstrap-> | ||
+ | $areaList = $om-> | ||
+ | $areaCode = $areaList-> | ||
+ | /** @var \Magento\Framework\App\State $state */ | ||
+ | $state = $om-> | ||
+ | $state-> | ||
+ | /** @var \Magento\Framework\ObjectManager\ConfigLoaderInterface $configLoader */ | ||
+ | $configLoader = $om-> | ||
+ | $om-> | ||
+ | // end initialize Magento environment | ||
+ | |||
+ | </ | ||
+ | |||
+ | <file php urapidflow.php> | ||
+ | <?php | ||
+ | include __DIR__ . '/ | ||
+ | |||
+ | // download from http location | ||
+ | $res = @copy(' | ||
+ | if ($res !== true) { | ||
+ | echo 'ERROR downloading file'; | ||
+ | exit; | ||
+ | } | ||
+ | |||
+ | // unpack the archive | ||
+ | $zip = new ZipArchive(); | ||
+ | $res = $zip-> | ||
+ | if ($res !== true) { | ||
+ | echo 'ERROR unpacking archive'; | ||
+ | exit; | ||
+ | } | ||
+ | $zip-> | ||
+ | $zip-> | ||
+ | |||
+ | // run the profile, which should be associated with final import file | ||
+ | $om-> | ||
+ | |||
+ | </ |