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