Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
EntryPoint.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\ObjectManager;
10 
17 {
21  protected $_rootDir;
22 
26  protected $_parameters;
27 
33  protected $_locator;
34 
41  public function __construct(
42  $rootDir,
43  array $parameters = [],
44  ObjectManager $objectManager = null
45  ) {
46  $this->_rootDir = $rootDir;
47  $this->_parameters = $parameters;
48  $this->_locator = $objectManager;
49  }
50 
59  public function run($applicationName, array $arguments = [])
60  {
61  try {
62  if (!$this->_locator) {
63  $locatorFactory = new \Magento\Mtf\ObjectManagerFactory();
64  $this->_locator = $locatorFactory->create();
65  }
66  return $this->_locator->create($applicationName, $arguments)->launch();
67  } catch (\Exception $exception) {
68  $message = "Error happened during application run.\n";
69  $message .= $exception->getMessage();
70  throw new \DomainException($message);
71  }
72  }
73 }
$objectManager
Definition: bootstrap.php:17
Definition: EntryPoint.php:16
__construct( $rootDir, array $parameters=[], ObjectManager $objectManager=null)
Definition: EntryPoint.php:41
run($applicationName, array $arguments=[])
Definition: EntryPoint.php:59
Definition: EntryPoint.php:7
$message
$_rootDir
Definition: EntryPoint.php:21
$arguments
$rootDir
Definition: website.php:12
$_locator
Definition: EntryPoint.php:33
$_parameters
Definition: EntryPoint.php:26