Config
Config Class for simple config manipulation of multiple formats.
Constants
CNF
php
public const CNF = \pocketmine\utils\Config::PROPERTIESDETECT
php
public const DETECT = -1ENUM
php
public const ENUM = 5ENUMERATION
php
public const ENUMERATION = \pocketmine\utils\Config::ENUMJSON
php
public const JSON = 1PROPERTIES
php
public const PROPERTIES = 0SERIALIZED
php
public const SERIALIZED = 4YAML
php
public const YAML = 2Properties
$formats
php
public static array $formatsMethods
__construct()
php
public function __construct(string $file, int $type = \pocketmine\utils\Config::DETECT, array $default = [])__get()
php
public function __get($k)__isset()
php
public function __isset($k)__set()
php
public function __set($k, $v) : void__unset()
php
public function __unset($k)disableJsonOption()
php
public function disableJsonOption(int $option) : \pocketmine\utils\ConfigDisables the given option for the JSON encoding when saving
enableJsonOption()
php
public function enableJsonOption(int $option) : \pocketmine\utils\ConfigEnables the given option in addition to the currently set JSON options
exists()
php
public function exists(string $k, bool $lowercase = false) : boolfixYAMLIndexes()
php
public static function fixYAMLIndexes(string $str) : stringget()
php
public function get(string $k, mixed $default = false) : mixedgetAll()
php
public function getAll(bool $keys = false) : arraygetJsonOptions()
php
public function getJsonOptions() : intReturns the options for the JSON encoding when saving
getNested()
php
public function getNested(string $key, mixed $default = null) : mixedgetPath()
php
public function getPath() : stringReturns the path of the config.
hasChanged()
php
public function hasChanged() : boolparseList()
php
public static function parseList(string $content) : arrayparseProperties()
php
public static function parseProperties(string $content) : arrayreload()
php
public function reload() : voidRemoves all the changes in memory and loads the file again
remove()
php
public function remove(string $k) : voidremoveNested()
php
public function removeNested(string $key) : voidsave()
php
public function save() : voidFlushes the config to disk in the appropriate format.
set()
php
public function set(string $k, mixed $v = true) : voidsetAll()
php
public function setAll(array $v) : voidsetChanged()
php
public function setChanged(bool $changed = true) : voidsetDefaults()
php
public function setDefaults(array $defaults) : voidsetJsonOptions()
php
public function setJsonOptions(int $options) : \pocketmine\utils\ConfigSets the options for the JSON encoding when saving
setNested()
php
public function setNested(string $key, mixed $value) : voidwriteList()
php
public static function writeList(array $entries) : stringwriteProperties()
php
public static function writeProperties(array $config) : string