Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
EntryPoint Class Reference

Public Member Functions

 __construct ( $rootDir, array $parameters=[], ObjectManager $objectManager=null)
 
 run ($applicationName, array $arguments=[])
 

Protected Attributes

 $_rootDir
 
 $_parameters
 
 $_locator
 

Detailed Description

Class EntryPoint Application entry point, used to bootstrap and run application

Definition at line 16 of file EntryPoint.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $rootDir,
array  $parameters = [],
ObjectManager  $objectManager = null 
)
Parameters
string$rootDir
array$parameters
ObjectManager$objectManager@SuppressWarnings(PHPMD.ExitExpression)

Definition at line 41 of file EntryPoint.php.

45  {
46  $this->_rootDir = $rootDir;
47  $this->_parameters = $parameters;
48  $this->_locator = $objectManager;
49  }
$objectManager
Definition: bootstrap.php:17
$rootDir
Definition: website.php:12

Member Function Documentation

◆ run()

run (   $applicationName,
array  $arguments = [] 
)

Run a Mtf application

Parameters
$applicationName
array$arguments
Returns
mixed
Exceptions

Definition at line 59 of file EntryPoint.php.

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  }
$message
$arguments

Field Documentation

◆ $_locator

$_locator
protected

Definition at line 33 of file EntryPoint.php.

◆ $_parameters

$_parameters
protected

Definition at line 26 of file EntryPoint.php.

◆ $_rootDir

$_rootDir
protected

Definition at line 21 of file EntryPoint.php.


The documentation for this class was generated from the following file: