PHP Класс Voodoo\Core\Config

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

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

Метод Описание
__callStatic ( type $name, type $args ) : Config Statically load any INI file. IE \Core\INI::Settings()->toArray()
__construct ( string $namespace ) Constructor
arrayToINI ( array $iniArray, integer $indent ) : String. To convert an array into a properly formatted INI file
get ( type $dotNotation = "", type $emptyValue = null ) : Mix Access value of an array with dot notation
getNamespace ( ) : Array Return the namespace data
loadFile ( type $file, type $keyname = "" ) To load an .ini file
namespaceExists ( ) : boolean Check if a namespace exists
save ( type $fileName = "" ) Save the ini file.
set ( array $data, type $keyName = "" ) Set data in the loaded
toArray ( ) : Array Return the INI array

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

__callStatic() публичный статический Метод

Statically load any INI file. IE \Core\INI::Settings()->toArray()
public static __callStatic ( type $name, type $args ) : Config
$name type
$args type
Результат Config

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

Constructor
public __construct ( string $namespace )
$namespace string - A unique name that will hold data for each set of config

arrayToINI() публичный статический Метод

To convert an array into a properly formatted INI file
public static arrayToINI ( array $iniArray, integer $indent ) : String.
$iniArray array
$indent integer
Результат String.

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

Access value of an array with dot notation
public get ( type $dotNotation = "", type $emptyValue = null ) : Mix
$dotNotation type - the key. ie: Key.Field1
$emptyValue type - Use this value if empty
Результат Mix ie self::get("QA.UpVoteQuestion"); Will return the value of [QA][UpVoteQuestion]

getNamespace() публичный Метод

Return the namespace data
public getNamespace ( ) : Array
Результат Array

loadFile() публичный Метод

To load an .ini file
public loadFile ( type $file, type $keyname = "" )
$file type
$keyname type

namespaceExists() публичный Метод

Check if a namespace exists
public namespaceExists ( ) : boolean
Результат boolean

save() публичный Метод

ATTENTION: It will remove all comments added. At this time, it's limited to 2 depth
public save ( type $fileName = "" )
$fileName type - The filename without the extension

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

Set data in the loaded
public set ( array $data, type $keyName = "" )
$data array
$keyName type

toArray() публичный Метод

Return the INI array
public toArray ( ) : Array
Результат Array