PHP Class luya\base\Boot

Author: nadar
Afficher le fichier Open project: luyadev/luya

Méthodes publiques

Свойство 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.

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

applicationWeb() public méthode

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

getConfigArray() public méthode

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

getCoreBasePath() public méthode

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

getSapiName() public méthode

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

run() public méthode

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

setConfigArray() public méthode

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 méthode

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

Property Details

$app public_oe property

The application object.
public $app

$configFile public_oe property

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

$mockOnly public_oe property

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