trait PhpConfigFile

Php Config file loader and writer

Properties

protected array $comments Config array comments

Methods

array|null
include(string $fileName)

Include config file

array|null
includePhpArray(string $fileName)

Include php array

void
setComment(string $comment, string $key)

Set array key comment

string
getCommentsText(string $key)

Get array imtem comment as text

string
exportArray(array $data, string $arrayKey, int $currentTab = 1, int $endTab = 1)

Export array as text

string
exportItem(string $key, mixed $value, int $maxTabs)

Export item as text

string
exportConfig(array $data)

Export config as text

bool
saveConfigFile(string $fileName, array $data)

Save config file

Details

at line 33
array|null include(string $fileName)

Include config file

Parameters

string $fileName

Return Value

array|null

at line 44
array|null includePhpArray(string $fileName)

Include php array

Parameters

string $fileName

Return Value

array|null

at line 62
protected void setComment(string $comment, string $key)

Set array key comment

Parameters

string $comment
string $key

Return Value

void

at line 73
protected string getCommentsText(string $key)

Get array imtem comment as text

Parameters

string $key

Return Value

string

at line 100
protected string exportArray(array $data, string $arrayKey, int $currentTab = 1, int $endTab = 1)

Export array as text

Parameters

array $data
string $arrayKey
int $currentTab
int $endTab

Return Value

string

at line 144
protected string exportItem(string $key, mixed $value, int $maxTabs)

Export item as text

Parameters

string $key
mixed $value
int $maxTabs

Return Value

string

at line 158
protected string exportConfig(array $data)

Export config as text

Parameters

array $data

Return Value

string

at line 245
bool saveConfigFile(string $fileName, array $data)

Save config file

Parameters

string $fileName
array $data

Return Value

bool