PHP Класс Voodoo\Core\Env

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
getAppRootDir ( ) : string Get the app dir
getApplicationBaseDir ( ) : string Get the running application's base dir, usually the root where index.php is being run
getConfigPath ( ) : string Get the config
getFrontControllerPath ( ) : string Return the front controller path
getHostName ( ) : string Get the server http host name
getPublicAssetsPath ( ) : string Get the public assets
getRootDir ( ) : string Root of Voodoo directory
getServerName ( ) : string Return the server name
getUrl ( ) : string Get the domain url
getVoodooistPath ( )
isCLI ( ) : boolean Check if the SAPI is CLI or not
isDev ( ) : boolean Check if DEV enviroment
isHttps ( ) : boolean Check if the environment is under HTTPS
isProduction ( ) : boolean Check if PRODUCTION enviroment
isStaging ( ) : boolean Check if STAGING enviroment
sessionStart ( ) To start a session if it's not active Once set, you can use $_SESSION to work with your data
set ( integer $env = self::DEV ) Set the environment we're working on. ie: DEV, PRODUCTION, STAGING
setAppRootDir ( $rootDir ) Set the app dir
setConfigPath ( string $dirName ) By default the config is under /App/_conf, But you can have multiple environment like production, dev So it would be placed under /App/_conf/production, /App/_conf/dev etc $dirname is the subdirectory name, ie: production
setFrontControllerPath ( $rootDir ) Set the front controller path, where the index will be created
setPublicAssetsPath ( string $rootDir ) Set the public assets

Описание методов

getAppRootDir() публичный статический Метод

Get the app dir
public static getAppRootDir ( ) : string
Результат string

getApplicationBaseDir() публичный статический Метод

Get the running application's base dir, usually the root where index.php is being run
public static getApplicationBaseDir ( ) : string
Результат string

getConfigPath() публичный статический Метод

Get the config
public static getConfigPath ( ) : string
Результат string

getFrontControllerPath() публичный статический Метод

Return the front controller path
public static getFrontControllerPath ( ) : string
Результат string

getHostName() публичный статический Метод

Get the server http host name
public static getHostName ( ) : string
Результат string

getPublicAssetsPath() публичный статический Метод

Get the public assets
public static getPublicAssetsPath ( ) : string
Результат string

getRootDir() публичный статический Метод

Root of Voodoo directory
public static getRootDir ( ) : string
Результат string

getServerName() публичный статический Метод

Return the server name
public static getServerName ( ) : string
Результат string

getUrl() публичный статический Метод

Get the domain url
public static getUrl ( ) : string
Результат string

getVoodooistPath() публичный статический Метод

public static getVoodooistPath ( )

isCLI() публичный статический Метод

Check if the SAPI is CLI or not
public static isCLI ( ) : boolean
Результат boolean

isDev() публичный статический Метод

Check if DEV enviroment
public static isDev ( ) : boolean
Результат boolean

isHttps() публичный статический Метод

Check if the environment is under HTTPS
public static isHttps ( ) : boolean
Результат boolean

isProduction() публичный статический Метод

Check if PRODUCTION enviroment
public static isProduction ( ) : boolean
Результат boolean

isStaging() публичный статический Метод

Check if STAGING enviroment
public static isStaging ( ) : boolean
Результат boolean

sessionStart() публичный статический Метод

To start a session if it's not active Once set, you can use $_SESSION to work with your data
public static sessionStart ( )

set() публичный статический Метод

Set the environment we're working on. ie: DEV, PRODUCTION, STAGING
public static set ( integer $env = self::DEV )
$env integer

setAppRootDir() публичный статический Метод

Set the app dir
public static setAppRootDir ( $rootDir )

setConfigPath() публичный статический Метод

By default the config is under /App/_conf, But you can have multiple environment like production, dev So it would be placed under /App/_conf/production, /App/_conf/dev etc $dirname is the subdirectory name, ie: production
public static setConfigPath ( string $dirName )
$dirName string

setFrontControllerPath() публичный статический Метод

Set the front controller path, where the index will be created
public static setFrontControllerPath ( $rootDir )

setPublicAssetsPath() публичный статический Метод

Set the public assets
public static setPublicAssetsPath ( string $rootDir )
$rootDir string