PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
pocketmine\utils\Config Class Reference
+ Collaboration diagram for pocketmine\utils\Config:

Public Member Functions

 __construct ($file, $type=Config::DETECT, $default=[], &$correct=null)
 
 reload ()
 
 load ($file, $type=Config::DETECT, $default=[])
 
 check ()
 
 save ()
 
 __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)
 

Static Public Member Functions

static fixYAMLIndexes ($str)
 

Public Attributes

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 Public Attributes

static $formats
 
static cnf
 

Detailed Description

Class Config

Config Class for simple config manipulation of multiple formats.

Definition at line 30 of file Config.php.

Constructor & Destructor Documentation

pocketmine\utils\Config::__construct (   $file,
  $type = Config::DETECT,
  $default = [],
$correct = null 
)
Parameters
string$filePath of the file to be loaded
int$typeConfig type to load, -1 by default (detect)
array$defaultArray with the default values, will be set if not existent
null&$correctSets correct to true if everything has been loaded correctly

Definition at line 74 of file Config.php.

References pocketmine\utils\Config\load().

+ Here is the call graph for this function:

Member Function Documentation

pocketmine\utils\Config::__get (   $k)
Parameters
$k
Returns
boolean|mixed

Definition at line 208 of file Config.php.

pocketmine\utils\Config::__isset (   $k)
Parameters
$k
Returns
boolean

Definition at line 225 of file Config.php.

References pocketmine\utils\Config\exists().

+ Here is the call graph for this function:

pocketmine\utils\Config::__set (   $k,
  $v 
)
Parameters
$k
$v

Definition at line 216 of file Config.php.

References pocketmine\utils\Config\set().

+ Here is the call graph for this function:

pocketmine\utils\Config::__unset (   $k)
Parameters
$k

Definition at line 232 of file Config.php.

pocketmine\utils\Config::check ( )
Returns
boolean

Definition at line 167 of file Config.php.

pocketmine\utils\Config::exists (   $k,
  $lowercase = false 
)
Parameters
$k
bool$lowercaseIf set, searches Config in single-case / lowercase.
Returns
boolean

Definition at line 359 of file Config.php.

Referenced by pocketmine\utils\Config\__isset().

+ Here is the caller graph for this function:

static pocketmine\utils\Config::fixYAMLIndexes (   $str)
static
Parameters
$str
Returns
mixed

Definition at line 94 of file Config.php.

pocketmine\utils\Config::get (   $k,
  $default = false 
)
Parameters
$k
$default
Returns
boolean|mixed

Definition at line 294 of file Config.php.

pocketmine\utils\Config::getAll (   $keys = false)
Parameters
bool$keys
Returns
array

Definition at line 381 of file Config.php.

pocketmine\utils\Config::getNested (   $key,
  $default = null 
)
Parameters
$key
null$default
Returns
mixed

Definition at line 267 of file Config.php.

pocketmine\utils\Config::getPath (   $path)
Parameters
string$path
Deprecated:
Returns
mixed

Definition at line 305 of file Config.php.

pocketmine\utils\Config::load (   $file,
  $type = Config::DETECT,
  $default = [] 
)
Parameters
$file
int$type
array$default
Returns
bool

Definition at line 105 of file Config.php.

References pocketmine\utils\Config\save().

Referenced by pocketmine\utils\Config\__construct(), and pocketmine\utils\Config\reload().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

pocketmine\utils\Config::reload ( )

Removes all the changes in memory and loads the file again

Definition at line 82 of file Config.php.

References pocketmine\utils\Config\load().

+ Here is the call graph for this function:

pocketmine\utils\Config::remove (   $k)
Parameters
$k

Definition at line 372 of file Config.php.

pocketmine\utils\Config::save ( )
Returns
boolean

Definition at line 174 of file Config.php.

Referenced by pocketmine\utils\Config\load().

+ Here is the caller graph for this function:

pocketmine\utils\Config::set (   $k,
  $v = true 
)
Parameters
string$kkey to be set
mixed$vvalue to set key

Definition at line 342 of file Config.php.

Referenced by pocketmine\utils\Config\__set().

+ Here is the caller graph for this function:

pocketmine\utils\Config::setAll (   $v)
Parameters
array$v

Definition at line 349 of file Config.php.

pocketmine\utils\Config::setDefaults ( array  $defaults)
Parameters
array$defaults

Definition at line 388 of file Config.php.

pocketmine\utils\Config::setNested (   $key,
  $value 
)
Parameters
$key
$value

Definition at line 240 of file Config.php.

pocketmine\utils\Config::setPath (   $path,
  $value 
)
Deprecated:
Parameters
string$path
mixed$value

Definition at line 325 of file Config.php.

Member Data Documentation

pocketmine\utils\Config::$formats
static
Initial value:
= [
"properties" => Config::PROPERTIES

Definition at line 50 of file Config.php.

pocketmine\utils\Config::cnf
static
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,
]

Definition at line 52 of file Config.php.


The documentation for this class was generated from the following file: