PHP Class pocketmine\utils\Config

Config Class for simple config manipulation of multiple formats.
Exibir arquivo Open project: iTXTech/Genisys Class Usage Examples

Public Properties

Property Type Description
$formats

Public Methods

Method 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

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

Method Details

__construct() public method

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 method

public __get ( $k ) : boolean | mixed
$k
return boolean | mixed

__isset() public method

public __isset ( $k ) : boolean
$k
return boolean

__set() public method

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

__unset() public method

public __unset ( $k )
$k

check() public method

public check ( ) : boolean
return boolean

exists() public method

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

fixYAMLIndexes() public static method

public static fixYAMLIndexes ( $str ) : mixed
$str
return mixed

get() public method

public get ( $k, mixed $default = false ) : boolean | mixed
$k
$default mixed
return boolean | mixed

getAll() public method

public getAll ( boolean $keys = false ) : array
$keys boolean
return array

getNested() public method

public getNested ( $key, mixed $default = null ) : mixed
$key
$default mixed
return mixed

load() public method

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

reload() public method

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

remove() public method

public remove ( $k )
$k

save() public method

public save ( boolean $async = false ) : boolean
$async boolean
return boolean

set() public method

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

setAll() public method

public setAll ( array $v )
$v array

setDefaults() public method

public setDefaults ( array $defaults )
$defaults array

setNested() public method

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

Property Details

$formats public_oe static_oe property

public static $formats