PHP Class Sven\FlexEnv\Env

Afficher le fichier Open project: svenluijten/flex-env Class Usage Examples

Protected Properties

Свойство Type Description
$path string
$previous string

Méthodes publiques

Méthode Description
__construct ( string $path ) Instantiate the Env.
all ( ) : array Gets all the key/value pairs from the .env file.
copy ( string $destination, boolean $excludeValues = false ) : boolean Copy the .env file to the given destination.
delete ( string $key ) : Env Delete an entry from the .env file.
get ( string $key ) : string Get an entry from the .env file by key.
getPath ( ) : string Get the full path to the .env file.
replaceInFile ( string $old, string $new, integer $append ) : Env Replace a part of the .env file.
rollback ( ) : Env Rolls the .env file back to the way it was before performing the command.
set ( string $key, string $value, boolean $linebreak = false ) : Env Set the value of the given key to the value supplied.

Private Methods

Méthode Description
parseFile ( ) : Collection Parse the .env file contents for easier handling.

Method Details

__construct() public méthode

Instantiate the Env.
public __construct ( string $path )
$path string

all() public méthode

Gets all the key/value pairs from the .env file.
public all ( ) : array
Résultat array

copy() public méthode

Copy the .env file to the given destination.
public copy ( string $destination, boolean $excludeValues = false ) : boolean
$destination string Full path to copy the file to
$excludeValues boolean Whether or not to include values
Résultat boolean

delete() public méthode

Delete an entry from the .env file.
public delete ( string $key ) : Env
$key string
Résultat Env

get() public méthode

Get an entry from the .env file by key.
public get ( string $key ) : string
$key string
Résultat string

getPath() public méthode

Get the full path to the .env file.
public getPath ( ) : string
Résultat string

replaceInFile() public méthode

Replace a part of the .env file.
public replaceInFile ( string $old, string $new, integer $append ) : Env
$old string
$new string
$append integer
Résultat Env

rollback() public méthode

Rolls the .env file back to the way it was before performing the command.
public rollback ( ) : Env
Résultat Env

set() public méthode

Set the value of the given key to the value supplied.
public set ( string $key, string $value, boolean $linebreak = false ) : Env
$key string
$value string
$linebreak boolean
Résultat Env

Property Details

$path protected_oe property

protected string $path
Résultat string

$previous protected_oe property

protected string $previous
Résultat string