Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
EnvFile Class Reference

Static Public Member Functions

static save (array $content,?string $path=null, string $filename='.env')
 Saves a content array on disk.
 
static saveText (string $textContent,?string $path=null, string $filename='.env')
 Savec a content text on disk.
 
static addAndSave (array $content,?string $path=null, string $filename='.env')
 Adds a content array to an existing env file and saves it to disk.
 
static load (?string $path=null, string $filename='.env')
 Loads an env file an returns an array of key/value pairs.
 
static loadContent (?string $path=null, string $filename='.env')
 

Static Public Attributes

static string $ENV_ROOT =\ROOT.'../'
 

Static Private Member Functions

static parseValue ($v)
 

Detailed Description

Definition at line 15 of file EnvFile.php.

Member Function Documentation

◆ addAndSave()

static addAndSave ( array  $content,
?string  $path = null,
string  $filename = '.env' 
)
static

Adds a content array to an existing env file and saves it to disk.

Parameters
array$content
string | null$path
string$filename
Returns
false|int

Definition at line 73 of file EnvFile.php.

◆ load()

static load ( ?string  $path = null,
string  $filename = '.env' 
)
static

Loads an env file an returns an array of key/value pairs.

Parameters
string | null$path
string$filename
Returns
array

Definition at line 87 of file EnvFile.php.

◆ loadContent()

static loadContent ( ?string  $path = null,
string  $filename = '.env' 
)
static

Definition at line 95 of file EnvFile.php.

◆ parseValue()

static parseValue (   $v)
staticprivate
Parameters
$v
Returns
int|string

Definition at line 23 of file EnvFile.php.

◆ save()

static save ( array  $content,
?string  $path = null,
string  $filename = '.env' 
)
static

Saves a content array on disk.

Parameters
array$content
string | null$path
string$filename
Returns
false|int

Definition at line 42 of file EnvFile.php.

◆ saveText()

static saveText ( string  $textContent,
?string  $path = null,
string  $filename = '.env' 
)
static

Savec a content text on disk.

Parameters
string$textContent
string | null$path
string$filename
Returns
false|int

Definition at line 60 of file EnvFile.php.

Field Documentation

◆ $ENV_ROOT

string $ENV_ROOT =\ROOT.'../'
static

Definition at line 17 of file EnvFile.php.


The documentation for this class was generated from the following file: