rest_mediatekdocuments

Dotenv
in package

Table of Contents

Properties

$loader  : LoaderInterface
The loader instance.
$parser  : ParserInterface
The parser instance.
$repository  : RepositoryInterface
The repository instance.
$store  : StoreInterface
The store instance.

Methods

__construct()  : void
Create a new dotenv instance.
create()  : Dotenv
Create a new dotenv instance.
createArrayBacked()  : Dotenv
Create a new dotenv instance with an array backed repository.
createImmutable()  : Dotenv
Create a new immutable dotenv instance with default repository.
createMutable()  : Dotenv
Create a new mutable dotenv instance with default repository.
createUnsafeImmutable()  : Dotenv
Create a new immutable dotenv instance with default repository with the putenv adapter.
createUnsafeMutable()  : Dotenv
Create a new mutable dotenv instance with default repository with the putenv adapter.
ifPresent()  : Validator
Returns a new validator object that won't check if the specified variables exist.
load()  : array<string, string|null>
Read and load environment file(s).
parse()  : array<string, string|null>
Parse the given content and resolve nested variables.
required()  : Validator
Required ensures that the specified variables exist, and returns a new validator object.
safeLoad()  : array<string, string|null>
Read and load environment file(s), silently failing if no files can be read.

Properties

Methods

create()

Create a new dotenv instance.

public static create(RepositoryInterface $repository, string|array<string|int, string> $paths[, string|array<string|int, string>|null $names = null ][, bool $shortCircuit = true ][, string|null $fileEncoding = null ]) : Dotenv
Parameters
$repository : RepositoryInterface
$paths : string|array<string|int, string>
$names : string|array<string|int, string>|null = null
$shortCircuit : bool = true
$fileEncoding : string|null = null
Return values
Dotenv

createArrayBacked()

Create a new dotenv instance with an array backed repository.

public static createArrayBacked(string|array<string|int, string> $paths[, string|array<string|int, string>|null $names = null ][, bool $shortCircuit = true ][, string|null $fileEncoding = null ]) : Dotenv
Parameters
$paths : string|array<string|int, string>
$names : string|array<string|int, string>|null = null
$shortCircuit : bool = true
$fileEncoding : string|null = null
Return values
Dotenv

createImmutable()

Create a new immutable dotenv instance with default repository.

public static createImmutable(string|array<string|int, string> $paths[, string|array<string|int, string>|null $names = null ][, bool $shortCircuit = true ][, string|null $fileEncoding = null ]) : Dotenv
Parameters
$paths : string|array<string|int, string>
$names : string|array<string|int, string>|null = null
$shortCircuit : bool = true
$fileEncoding : string|null = null
Return values
Dotenv

createMutable()

Create a new mutable dotenv instance with default repository.

public static createMutable(string|array<string|int, string> $paths[, string|array<string|int, string>|null $names = null ][, bool $shortCircuit = true ][, string|null $fileEncoding = null ]) : Dotenv
Parameters
$paths : string|array<string|int, string>
$names : string|array<string|int, string>|null = null
$shortCircuit : bool = true
$fileEncoding : string|null = null
Return values
Dotenv

createUnsafeImmutable()

Create a new immutable dotenv instance with default repository with the putenv adapter.

public static createUnsafeImmutable(string|array<string|int, string> $paths[, string|array<string|int, string>|null $names = null ][, bool $shortCircuit = true ][, string|null $fileEncoding = null ]) : Dotenv
Parameters
$paths : string|array<string|int, string>
$names : string|array<string|int, string>|null = null
$shortCircuit : bool = true
$fileEncoding : string|null = null
Return values
Dotenv

createUnsafeMutable()

Create a new mutable dotenv instance with default repository with the putenv adapter.

public static createUnsafeMutable(string|array<string|int, string> $paths[, string|array<string|int, string>|null $names = null ][, bool $shortCircuit = true ][, string|null $fileEncoding = null ]) : Dotenv
Parameters
$paths : string|array<string|int, string>
$names : string|array<string|int, string>|null = null
$shortCircuit : bool = true
$fileEncoding : string|null = null
Return values
Dotenv

ifPresent()

Returns a new validator object that won't check if the specified variables exist.

public ifPresent(string|array<string|int, string> $variables) : Validator
Parameters
$variables : string|array<string|int, string>
Return values
Validator

parse()

Parse the given content and resolve nested variables.

public static parse(string $content) : array<string, string|null>

This method behaves just like load(), only without mutating your actual environment. We do this by using an array backed repository.

Parameters
$content : string
Tags
throws
InvalidFileException
Return values
array<string, string|null>

required()

Required ensures that the specified variables exist, and returns a new validator object.

public required(string|array<string|int, string> $variables) : Validator
Parameters
$variables : string|array<string|int, string>
Return values
Validator

        
On this page

Search results