PHP Class luya\base\Boot

Author: nadar
Show file Open project: luyadev/luya

Public Properties

Property Type Description
$app The application object.
$configFile The path to the config file, which returns an array containing you configuration.
$mockOnly When enabled the boot process will not return/echo something, but the variabled will contain the Application object.

Public Methods

Method Description
applicationConsole ( ) : string | integer Run Cli-Application based on the provided config file.
applicationWeb ( ) : string Run Web-Application based on the provided config file.
getConfigArray ( ) : array Get the config array from the configFile path with the predefined values.
getCoreBasePath ( ) : string Returns the path to luya core files
getSapiName ( ) : string Returns the current sapi name in lower case.
run ( ) : luya\web\Application | luya\cli\Application Run the application based on the Sapi Name.
setConfigArray ( array $config ) This method allows you to directly inject a configuration array instead of using the config file method.
setYiiPath ( string $baseYiiFile ) Setter method for the base Yii file.

Private Methods

Method Description
includeYii ( ) : boolean Helper method to check whether the provided Yii Base file exists, if yes include and return the file.

Method Details

applicationConsole() public method

Run Cli-Application based on the provided config file.
public applicationConsole ( ) : string | integer
return string | integer

applicationWeb() public method

Run Web-Application based on the provided config file.
public applicationWeb ( ) : string
return string Returns the Yii Application run() method if mock is disabled. Otherwise returns void

getConfigArray() public method

Get the config array from the configFile path with the predefined values.
public getConfigArray ( ) : array
return array The array which will be injected into the Application Constructor.

getCoreBasePath() public method

Returns the path to luya core files
public getCoreBasePath ( ) : string
return string The base path to the luya core folder.

getSapiName() public method

Returns the current sapi name in lower case.
public getSapiName ( ) : string
return string e.g. cli or web

run() public method

Run the application based on the Sapi Name.
public run ( ) : luya\web\Application | luya\cli\Application
return luya\web\Application | luya\cli\Application Application objected based on the sapi name.

setConfigArray() public method

This method is commonly used when running php unit tests which do not require an additional file. php $app = new Boot(); $app->setConfigArray([ ... ]);
public setConfigArray ( array $config )
$config array The configuration array for the application.

setYiiPath() public method

Setter method for the base Yii file.
public setYiiPath ( string $baseYiiFile )
$baseYiiFile string The path to the Yii.php file.

Property Details

$app public property

The application object.
public $app

$configFile public property

The path to the config file, which returns an array containing you configuration.
public $configFile

$mockOnly public property

When enabled the boot process will not return/echo something, but the variabled will contain the Application object.
public $mockOnly