PHP Class Voodoo\Core\Env

ファイルを表示 Open project: voodoophp/voodoo Class Usage Examples

Public Methods

Method Description
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

Method Details

getAppRootDir() public static method

Get the app dir
public static getAppRootDir ( ) : string
return string

getApplicationBaseDir() public static method

Get the running application's base dir, usually the root where index.php is being run
public static getApplicationBaseDir ( ) : string
return string

getConfigPath() public static method

Get the config
public static getConfigPath ( ) : string
return string

getFrontControllerPath() public static method

Return the front controller path
public static getFrontControllerPath ( ) : string
return string

getHostName() public static method

Get the server http host name
public static getHostName ( ) : string
return string

getPublicAssetsPath() public static method

Get the public assets
public static getPublicAssetsPath ( ) : string
return string

getRootDir() public static method

Root of Voodoo directory
public static getRootDir ( ) : string
return string

getServerName() public static method

Return the server name
public static getServerName ( ) : string
return string

getUrl() public static method

Get the domain url
public static getUrl ( ) : string
return string

getVoodooistPath() public static method

public static getVoodooistPath ( )

isCLI() public static method

Check if the SAPI is CLI or not
public static isCLI ( ) : boolean
return boolean

isDev() public static method

Check if DEV enviroment
public static isDev ( ) : boolean
return boolean

isHttps() public static method

Check if the environment is under HTTPS
public static isHttps ( ) : boolean
return boolean

isProduction() public static method

Check if PRODUCTION enviroment
public static isProduction ( ) : boolean
return boolean

isStaging() public static method

Check if STAGING enviroment
public static isStaging ( ) : boolean
return boolean

sessionStart() public static method

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

set() public static method

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

setAppRootDir() public static method

Set the app dir
public static setAppRootDir ( $rootDir )

setConfigPath() public static method

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() public static method

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

setPublicAssetsPath() public static method

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