Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Member Functions
WebApiApplication Class Reference
Inheritance diagram for WebApiApplication:
Application

Public Member Functions

 run ()
 
 install ($cleanup)
 
- Public Member Functions inherited from Application
 __construct (\Magento\Framework\Shell $shell, $installDir, $installConfigFile, $globalConfigFile, $globalConfigDir, $appMode, AutoloaderInterface $autoloadWrapper, $loadTestExtensionAttributes=false)
 
 getDbInstance ()
 
 getTempDir ()
 
 getInitParams ()
 
 isInstalled ()
 
 reinitialize (array $overriddenParams=[])
 
 createInstallDir ()
 
 cleanup ()
 
 install ($cleanup)
 
 _customizeParams ($params)
 
 getArea ()
 
 loadArea ($areaCode)
 

Protected Member Functions

 getCustomDirs ()
 
- Protected Member Functions inherited from Application
 getInstallConfig ()
 
 _ensureDirExists ($dir)
 
 getCustomDirs ()
 

Additional Inherited Members

- Data Fields inherited from Application
const DEFAULT_APP_AREA = 'global'
 
- Protected Attributes inherited from Application
 $_db
 
 $_shell
 
 $installConfig
 
 $_globalConfigDir
 
 $installDir
 
 $_configDir
 
 $_initParams = []
 
 $_appMode
 
 $_appArea = null
 
 $_primaryConfigData = []
 
 $_factory
 
 $dirList
 
 $dumpDb = true
 
 $canLoadArea = true
 
 $canInstallSequence = true
 

Detailed Description

Provides access to the application for the tests

Allows installation and uninstallation

Definition at line 13 of file WebApiApplication.php.

Member Function Documentation

◆ getCustomDirs()

getCustomDirs ( )
protected

Use the application as is

{}

Definition at line 62 of file WebApiApplication.php.

63  {
64  return [];
65  }

◆ install()

install (   $cleanup)

{}

Definition at line 29 of file WebApiApplication.php.

30  {
31  if ($cleanup) {
32  $this->cleanup();
33  }
34 
35  $installOptions = $this->getInstallConfig();
36 
37  /* Install application */
38  if ($installOptions) {
39  $installCmd = 'php -f ' . BP . '/bin/magento setup:install -vvv';
40  $installArgs = [];
41  foreach ($installOptions as $optionName => $optionValue) {
42  if (is_bool($optionValue)) {
43  if (true === $optionValue) {
44  $installCmd .= " --$optionName";
45  }
46  continue;
47  }
48  if (!empty($optionValue)) {
49  $installCmd .= " --$optionName=%s";
50  $installArgs[] = $optionValue;
51  }
52  }
53  $this->_shell->execute($installCmd, $installArgs);
54  }
55  }
const BP
Definition: autoload.php:14

◆ run()

run ( )

{}

Definition at line 18 of file WebApiApplication.php.

19  {
20  throw new \Exception(
21  "Can't start application: purpose of Web API Application is to use classes and models from the application"
22  . " and don't run it"
23  );
24  }

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