PHP Class pocketmine\utils\Config

Config Class for simple config manipulation of multiple formats.
Afficher le fichier Open project: iTXTech/Genisys Class Usage Examples

Méthodes publiques

Свойство Type Description
$formats

Méthodes publiques

Méthode Description
__construct ( string $file, integer $type = Config::DETECT, array $default = [], &$correct = null )
__get ( $k ) : boolean | mixed
__isset ( $k ) : boolean
__set ( $k, $v )
__unset ( $k )
check ( ) : boolean
exists ( $k, boolean $lowercase = false ) : boolean
fixYAMLIndexes ( $str ) : mixed
get ( $k, mixed $default = false ) : boolean | mixed
getAll ( boolean $keys = false ) : array
getNested ( $key, mixed $default = null ) : mixed
load ( $file, integer $type = Config::DETECT, array $default = [] ) : boolean
reload ( ) Removes all the changes in memory and loads the file again
remove ( $k )
save ( boolean $async = false ) : boolean
set ( string $k, mixed $v = true )
setAll ( array $v )
setDefaults ( array $defaults )
setNested ( $key, $value )

Private Methods

Méthode Description
fillDefaults ( $default, &$data ) : integer
parseList ( $content )
parseProperties ( $content )
writeProperties ( ) : string

Method Details

__construct() public méthode

public __construct ( string $file, integer $type = Config::DETECT, array $default = [], &$correct = null )
$file string Path of the file to be loaded
$type integer Config type to load, -1 by default (detect)
$default array Array with the default values that will be written to the file if it did not exist

__get() public méthode

public __get ( $k ) : boolean | mixed
$k
Résultat boolean | mixed

__isset() public méthode

public __isset ( $k ) : boolean
$k
Résultat boolean

__set() public méthode

public __set ( $k, $v )
$k
$v

__unset() public méthode

public __unset ( $k )
$k

check() public méthode

public check ( ) : boolean
Résultat boolean

exists() public méthode

public exists ( $k, boolean $lowercase = false ) : boolean
$k
$lowercase boolean If set, searches Config in single-case / lowercase.
Résultat boolean

fixYAMLIndexes() public static méthode

public static fixYAMLIndexes ( $str ) : mixed
$str
Résultat mixed

get() public méthode

public get ( $k, mixed $default = false ) : boolean | mixed
$k
$default mixed
Résultat boolean | mixed

getAll() public méthode

public getAll ( boolean $keys = false ) : array
$keys boolean
Résultat array

getNested() public méthode

public getNested ( $key, mixed $default = null ) : mixed
$key
$default mixed
Résultat mixed

load() public méthode

public load ( $file, integer $type = Config::DETECT, array $default = [] ) : boolean
$file
$type integer
$default array
Résultat boolean

reload() public méthode

Removes all the changes in memory and loads the file again
public reload ( )

remove() public méthode

public remove ( $k )
$k

save() public méthode

public save ( boolean $async = false ) : boolean
$async boolean
Résultat boolean

set() public méthode

public set ( string $k, mixed $v = true )
$k string key to be set
$v mixed value to set key

setAll() public méthode

public setAll ( array $v )
$v array

setDefaults() public méthode

public setDefaults ( array $defaults )
$defaults array

setNested() public méthode

public setNested ( $key, $value )
$key
$value

Property Details

$formats public_oe static_oe property

public static $formats