PHP Класс Sven\FlexEnv\Env

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

Защищенные свойства (Protected)

Свойство Тип Описание
$path string
$previous string

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

Метод Описание
__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.

Приватные методы

Метод Описание
parseFile ( ) : Collection Parse the .env file contents for easier handling.

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

__construct() публичный метод

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

all() публичный метод

Gets all the key/value pairs from the .env file.
public all ( ) : array
Результат array

copy() публичный метод

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
Результат boolean

delete() публичный метод

Delete an entry from the .env file.
public delete ( string $key ) : Env
$key string
Результат Env

get() публичный метод

Get an entry from the .env file by key.
public get ( string $key ) : string
$key string
Результат string

getPath() публичный метод

Get the full path to the .env file.
public getPath ( ) : string
Результат string

replaceInFile() публичный метод

Replace a part of the .env file.
public replaceInFile ( string $old, string $new, integer $append ) : Env
$old string
$new string
$append integer
Результат Env

rollback() публичный метод

Rolls the .env file back to the way it was before performing the command.
public rollback ( ) : Env
Результат Env

set() публичный метод

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
Результат Env

Описание свойств

$path защищенное свойство

protected string $path
Результат string

$previous защищенное свойство

protected string $previous
Результат string