|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * Magiccart |
| 4 | + * @category Magiccart |
| 5 | + * @copyright Copyright (c) 2014 Magiccart (http://www.magiccart.net/) |
| 6 | + * @license http://www.magiccart.net/license-agreement.html |
| 7 | + * @Author: DOng NGuyen<[email protected]> |
| 8 | + * @@Create Date: 2018-03-20 21:14:06 |
| 9 | + * @@Modify Date: 2018-05-31 10:17:23 |
| 10 | + * @@Function: |
| 11 | + */ |
| 12 | +ini_set('display_startup_errors', 1);ini_set('display_errors', 1); error_reporting(-1); |
| 13 | +//// Setup Base |
| 14 | +ini_set('max_execution_time', 900000000); |
| 15 | + |
| 16 | +$folder = 'orfarm'; //Folder Name |
| 17 | +$file = $folder ? dirname(__FILE__) . "/$folder/app/bootstrap.php" : "app/bootstrap.php"; |
| 18 | +$file = str_replace('.com/', '.coms/', $file); |
| 19 | +$file = str_replace('/public_html/', '/public_htmls/', $file); |
| 20 | + |
| 21 | +if(!file_exists ($file)) $file = "app/bootstrap.php"; |
| 22 | +if(file_exists ($file)){ |
| 23 | + require $file; |
| 24 | + $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); |
| 25 | +} else {die('Not found bootstrap.php');} |
| 26 | + |
| 27 | + |
| 28 | +use Magento\Customer\Model\CustomerRegistry; |
| 29 | + |
| 30 | +class AccountManagement extends \Magento\Framework\App\Http |
| 31 | + implements \Magento\Framework\AppInterface { |
| 32 | + |
| 33 | + /** |
| 34 | + * @var CustomerRepositoryInterface |
| 35 | + */ |
| 36 | + private $customerRepository; |
| 37 | + |
| 38 | + /** |
| 39 | + * @param CustomerRegistry |
| 40 | + */ |
| 41 | + |
| 42 | + private $customerRegistry; |
| 43 | + |
| 44 | + public function launch() |
| 45 | + { |
| 46 | + |
| 47 | + $this->customerRegistry = $this->_objectManager->get( |
| 48 | + \Magento\Customer\Model\CustomerRegistry::class |
| 49 | + ); |
| 50 | + |
| 51 | + $this->customerRepository = $this->_objectManager->get( |
| 52 | + \Magento\Customer\Api\CustomerRepositoryInterface::class, |
| 53 | + ['customerRegistry' => $this->customerRegistry] |
| 54 | + ); |
| 55 | + |
| 56 | + echo 'Create customerRepository with customerRegistry'; |
| 57 | + |
| 58 | + |
| 59 | + return $this->_response; |
| 60 | + } |
| 61 | + |
| 62 | +} |
| 63 | + |
| 64 | +/** @var \Magento\Framework\App\Http $app */ |
| 65 | +$app = $bootstrap->createApplication('AccountManagement'); |
| 66 | +$bootstrap->run($app); |
0 commit comments