Class Dotenv\Dotenv

InheritanceDotenv\Dotenv

Dotenv.

Loads a .env file in the given directory and sets the environment vars.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$filePath string Dotenv\Dotenv
$loader Dotenv\Loader|null Dotenv\Dotenv

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Dotenv\Dotenv
load() Load .env file in given directory. Dotenv\Dotenv
overload() Load .env file in given directory. Dotenv\Dotenv
required() Required ensures that the specified variables exist, and returns a new Validation object. Dotenv\Dotenv

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
getFilePath() Returns the full path to the file ensuring that it's readable. Dotenv\Dotenv

Property Details

$filePath protected property
protected string $filePath null
$loader protected property
protected Dotenv\Loader|null $loader null

Method Details

__construct() public method

public void __construct ( $path, $file '.env' )
$path
$file
getFilePath() protected method

Returns the full path to the file ensuring that it's readable.

protected string getFilePath ( $path, $file )
$path string
$file string
load() public method

Load .env file in given directory.

public void load ( )
overload() public method

Load .env file in given directory.

public void overload ( )
required() public method

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

public Dotenv\Validator required ( $variable )
$variable mixed