|
| __construct ($file, $type=Config::DETECT, $default=[], &$correct=null) |
|
| reload () |
|
| load ($file, $type=Config::DETECT, $default=[]) |
|
| check () |
|
| save ($async=false) |
|
| __get ($k) |
|
| __set ($k, $v) |
|
| __isset ($k) |
|
| __unset ($k) |
|
| setNested ($key, $value) |
|
| getNested ($key, $default=null) |
|
| get ($k, $default=false) |
|
| getPath ($path) |
|
| setPath ($path, $value) |
|
| set ($k, $v=true) |
|
| setAll ($v) |
|
| exists ($k, $lowercase=false) |
|
| remove ($k) |
|
| getAll ($keys=false) |
|
| setDefaults (array $defaults) |
|
|
const | DETECT = -1 |
|
const | PROPERTIES = 0 |
|
const | CNF = Config::PROPERTIES |
|
const | JSON = 1 |
|
const | YAML = 2 |
|
const | SERIALIZED = 4 |
|
const | ENUM = 5 |
|
const | ENUMERATION = Config::ENUM |
|
|
static | $formats |
|
static | cnf |
|
Class Config
Config Class for simple config manipulation of multiple formats.
__construct |
( |
|
$file, |
|
|
|
$type = Config::DETECT , |
|
|
|
$default = [] , |
|
|
& |
$correct = null |
|
) |
| |
- Parameters
-
string | $file | Path of the file to be loaded |
int | $type | Config type to load, -1 by default (detect) |
array | $default | Array with the default values, will be set if not existent |
null | &$correct | Sets correct to true if everything has been loaded correctly |
- Parameters
-
- Returns
- boolean|mixed
- Parameters
-
- Returns
- boolean
exists |
( |
|
$k, |
|
|
|
$lowercase = false |
|
) |
| |
- Parameters
-
| $k | |
bool | $lowercase | If set, searches Config in single-case / lowercase. |
- Returns
- boolean
static fixYAMLIndexes |
( |
|
$str | ) |
|
|
static |
get |
( |
|
$k, |
|
|
|
$default = false |
|
) |
| |
- Parameters
-
- Returns
- boolean|mixed
getNested |
( |
|
$key, |
|
|
|
$default = null |
|
) |
| |
load |
( |
|
$file, |
|
|
|
$type = Config::DETECT , |
|
|
|
$default = [] |
|
) |
| |
- Parameters
-
| $file | |
int | $type | |
array | $default | |
- Returns
- bool
Removes all the changes in memory and loads the file again
- Parameters
-
- Returns
- boolean
- Parameters
-
string | $k | key to be set |
mixed | $v | value to set key |
setDefaults |
( |
array |
$defaults | ) |
|
setNested |
( |
|
$key, |
|
|
|
$value |
|
) |
| |
setPath |
( |
|
$path, |
|
|
|
$value |
|
) |
| |
Initial value:= [
"properties" => Config::PROPERTIES
Initial value:=> Config::CNF,
"conf" => Config::CNF,
"config" => Config::CNF,
"json" => Config::JSON,
"js" => Config::JSON,
"yml" => Config::YAML,
"yaml" => Config::YAML,
"sl" => Config::SERIALIZED,
"serialize" => Config::SERIALIZED,
"txt" => Config::ENUM,
"list" => Config::ENUM,
"enum" => Config::ENUM,
]
The documentation for this class was generated from the following file:
- /Users/Kids/Desktop/Doxygen/pocketmine/utils/Config.php