EnvResolver
in package
Uses
PathsTrait
Table of Contents
Properties
- $dotenv : Dotenv
- $allFiles : Arrayable|null
- All files in the environment directory
- $env : Arrayable
- Resolved environment variables
- $path : mixed|string
- The path to the environment directory
Methods
- __construct() : mixed
- all() : Arrayable
- Scan the environment directory and list all the files discovered grouped by type
- appRoot() : string
- The root folder of the application.
- envPath() : string
- getDirFor() : string|null
- Get the directory for a given alias
- getEnv() : Arrayable
- Get the environment variables
- getEnvFilePath() : string
- Get the environment file path
- getEnvKeys() : mixed
- mediaPath() : string
- The path to the resources directory.
- phpPath() : string
- phpVersion() : string
- publicPath() : string
- The directory where the frontend assets are stored.
- resolve() : void
- Load the environment variables
- resolveDatabaseConfigs() : void
- resolveDotEnv() : void
- Resolve the .env files in our environment We let dotenv handle this
- resolveIniFiles() : void
- Resolve the ini files in our environment If we find a database configuration file, we shall mark it as the database configuration file
- resolvePhpFiles() : void
- extractFromIniFile() : void
Properties
$dotenv
public
Dotenv
$dotenv
$allFiles
All files in the environment directory
private
Arrayable|null
$allFiles
$env
Resolved environment variables
private
Arrayable
$env
$path
The path to the environment directory
private
mixed|string
$path
Methods
__construct()
public
__construct([string|null $path = 'Environment' ]) : mixed
Parameters
- $path : string|null = 'Environment'
all()
Scan the environment directory and list all the files discovered grouped by type
public
all([string|null $path = null ]) : Arrayable
Parameters
- $path : string|null = null
Return values
ArrayableappRoot()
The root folder of the application.
public
appRoot([string|null $path = null ][, int $levels = 3 ]) : string
Parameters
- $path : string|null = null
- $levels : int = 3
Return values
stringenvPath()
public
envPath([string|null $path = null ]) : string
Parameters
- $path : string|null = null
Return values
stringgetDirFor()
Get the directory for a given alias
public
getDirFor(string $aliasName) : string|null
Parameters
- $aliasName : string
Return values
string|nullgetEnv()
Get the environment variables
public
getEnv() : Arrayable
Return values
ArrayablegetEnvFilePath()
Get the environment file path
public
getEnvFilePath() : string
Return values
stringgetEnvKeys()
public
getEnvKeys() : mixed
mediaPath()
The path to the resources directory.
public
mediaPath() : string
Return values
stringphpPath()
public
phpPath() : string
Return values
stringphpVersion()
public
phpVersion() : string
Return values
stringpublicPath()
The directory where the frontend assets are stored.
public
publicPath([ $path = null ]) : string
Parameters
Return values
stringresolve()
Load the environment variables
public
resolve() : void
resolveDatabaseConfigs()
public
resolveDatabaseConfigs(Filesystem $fs[, string|null $fileName = 'database.ini' ]) : void
Parameters
- $fs : Filesystem
- $fileName : string|null = 'database.ini'
resolveDotEnv()
Resolve the .env files in our environment We let dotenv handle this
public
resolveDotEnv() : void
resolveIniFiles()
Resolve the ini files in our environment If we find a database configuration file, we shall mark it as the database configuration file
public
resolveIniFiles() : void
resolvePhpFiles()
public
resolvePhpFiles() : void
extractFromIniFile()
private
extractFromIniFile(mixed $path) : void
Parameters
- $path : mixed