Config Class for simple config manipulation of multiple formats. 
Definition at line 63 of file Config.php.
 
◆ __construct()
      
        
          | pocketmine\utils\Config::__construct  | 
          ( | 
          string |           $file,  | 
        
        
           | 
           | 
          int |           $type = Config::DETECT,  | 
        
        
           | 
           | 
          array |           $default = [] ) | 
        
      
 
- Parameters
 - 
  
    | string | $file | Path of the file to be loaded  | 
    | int | $type | Config type to load, -1 by default (detect)  | 
    | mixed[] | $default | Array with the default values that will be written to the file if it did not exist @phpstan-param array<string, mixed> $default  | 
  
   
Definition at line 117 of file Config.php.
 
 
◆ __get()
      
        
          | pocketmine\utils\Config::__get  | 
          ( | 
           |           $k | ) | 
           | 
        
      
 
- Parameters
 - 
  
  
 
- Returns
 - bool|mixed 
 
Definition at line 314 of file Config.php.
 
 
◆ __isset()
      
        
          | pocketmine\utils\Config::__isset  | 
          ( | 
           |           $k | ) | 
           | 
        
      
 
- Parameters
 - 
  
  
 
- Returns
 - bool 
 
Definition at line 331 of file Config.php.
 
 
◆ __set()
      
        
          | pocketmine\utils\Config::__set  | 
          ( | 
           |           $k,  | 
        
        
           | 
           | 
           |           $v ) | 
        
      
 
 
◆ __unset()
      
        
          | pocketmine\utils\Config::__unset  | 
          ( | 
           |           $k | ) | 
           | 
        
      
 
 
◆ disableJsonOption()
      
        
          | pocketmine\utils\Config::disableJsonOption  | 
          ( | 
          int |           $option | ) | 
           | 
        
      
 
Disables the given option for the JSON encoding when saving
- Returns
 - $this 
 
- Exceptions
 - 
  
  
 
RuntimeException if the Config is not in JSON 
- See also
 - json_encode 
 
Definition at line 286 of file Config.php.
 
 
◆ enableJsonOption()
      
        
          | pocketmine\utils\Config::enableJsonOption  | 
          ( | 
          int |           $option | ) | 
           | 
        
      
 
Enables the given option in addition to the currently set JSON options
- Returns
 - $this 
 
- Exceptions
 - 
  
  
 
RuntimeException if the Config is not in JSON 
- See also
 - json_encode 
 
Definition at line 269 of file Config.php.
 
 
◆ exists()
      
        
          | pocketmine\utils\Config::exists  | 
          ( | 
          string |           $k,  | 
        
        
           | 
           | 
          bool |           $lowercase = false ) | 
        
      
 
- Parameters
 - 
  
    | bool | $lowercase | If set, searches Config in single-case / lowercase.  | 
  
   
Definition at line 437 of file Config.php.
 
 
◆ fixYAMLIndexes()
  
  
      
        
          | static pocketmine\utils\Config::fixYAMLIndexes  | 
          ( | 
          string |           $str | ) | 
           | 
         
       
   | 
  
static   | 
  
 
 
◆ get()
      
        
          | pocketmine\utils\Config::get  | 
          ( | 
          string |           $k,  | 
        
        
           | 
           | 
          mixed |           $default = false ) | 
        
      
 
 
◆ getAll()
      
        
          | pocketmine\utils\Config::getAll  | 
          ( | 
          bool |           $keys = false | ) | 
           | 
        
      
 
- Returns
 - mixed[] @phpstan-return list<mixed>|array<mixed, mixed> 
 
Definition at line 456 of file Config.php.
 
 
◆ getJsonOptions()
      
        
          | pocketmine\utils\Config::getJsonOptions  | 
          ( | 
           | ) | 
           | 
        
      
 
Returns the options for the JSON encoding when saving
- Exceptions
 - 
  
  
 
RuntimeException if the Config is not in JSON 
- See also
 - json_encode 
 
Definition at line 302 of file Config.php.
 
 
◆ getNested()
      
        
          | pocketmine\utils\Config::getNested  | 
          ( | 
          string |           $key,  | 
        
        
           | 
           | 
          mixed |           $default = null ) | 
        
      
 
 
◆ getPath()
      
        
          | pocketmine\utils\Config::getPath  | 
          ( | 
           | ) | 
           | 
        
      
 
Returns the path of the config. 
Definition at line 211 of file Config.php.
 
 
◆ hasChanged()
      
        
          | pocketmine\utils\Config::hasChanged  | 
          ( | 
           | ) | 
           | 
        
      
 
 
◆ parseList()
  
  
      
        
          | static pocketmine\utils\Config::parseList  | 
          ( | 
          string |           $content | ) | 
           | 
         
       
   | 
  
static   | 
  
 
- Returns
 - string[] @phpstan-return list<string> 
 
Definition at line 497 of file Config.php.
 
 
◆ parseProperties()
  
  
      
        
          | static pocketmine\utils\Config::parseProperties  | 
          ( | 
          string |           $content | ) | 
           | 
         
       
   | 
  
static   | 
  
 
- Returns
 - string[]|int[]|float[]|bool[] @phpstan-return array<int|string, string|int|float|bool> 
 
Definition at line 537 of file Config.php.
 
 
◆ reload()
      
        
          | pocketmine\utils\Config::reload  | 
          ( | 
           | ) | 
           | 
        
      
 
Removes all the changes in memory and loads the file again 
Definition at line 124 of file Config.php.
 
 
◆ remove()
      
        
          | pocketmine\utils\Config::remove  | 
          ( | 
          string |           $k | ) | 
           | 
        
      
 
 
◆ removeNested()
      
        
          | pocketmine\utils\Config::removeNested  | 
          ( | 
          string |           $key | ) | 
           | 
        
      
 
 
◆ save()
      
        
          | pocketmine\utils\Config::save  | 
          ( | 
           | ) | 
           | 
        
      
 
Flushes the config to disk in the appropriate format. 
Definition at line 218 of file Config.php.
 
 
◆ set()
      
        
          | pocketmine\utils\Config::set  | 
          ( | 
          string |           $k,  | 
        
        
           | 
           | 
          mixed |           $v = true ) | 
        
      
 
 
◆ setAll()
      
        
          | pocketmine\utils\Config::setAll  | 
          ( | 
          array |           $v | ) | 
           | 
        
      
 
- Parameters
 - 
  
    | mixed[] | $v | @phpstan-param array<string, mixed> $v  | 
  
   
Definition at line 429 of file Config.php.
 
 
◆ setChanged()
      
        
          | pocketmine\utils\Config::setChanged  | 
          ( | 
          bool |           $changed = true | ) | 
           | 
        
      
 
 
◆ setDefaults()
      
        
          | pocketmine\utils\Config::setDefaults  | 
          ( | 
          array |           $defaults | ) | 
           | 
        
      
 
 
◆ setJsonOptions()
      
        
          | pocketmine\utils\Config::setJsonOptions  | 
          ( | 
          int |           $options | ) | 
           | 
        
      
 
Sets the options for the JSON encoding when saving
- Returns
 - $this 
 
- Exceptions
 - 
  
  
 
RuntimeException if the Config is not in JSON 
- See also
 - json_encode 
 
Definition at line 252 of file Config.php.
 
 
◆ setNested()
      
        
          | pocketmine\utils\Config::setNested  | 
          ( | 
          string |           $key,  | 
        
        
           | 
           | 
          mixed |           $value ) | 
        
      
 
 
◆ writeList()
  
  
      
        
          | static pocketmine\utils\Config::writeList  | 
          ( | 
          array |           $entries | ) | 
           | 
         
       
   | 
  
static   | 
  
 
- Parameters
 - 
  
    | string[] | int[] | $entries | @phpstan-param list<int|string> $entries  | 
  
   
Definition at line 513 of file Config.php.
 
 
◆ writeProperties()
  
  
      
        
          | static pocketmine\utils\Config::writeProperties  | 
          ( | 
          array |           $config | ) | 
           | 
         
       
   | 
  
static   | 
  
 
- Parameters
 - 
  
    | string[] | int[] | float[] | bool[] | $config | @phpstan-param array<int|string, string|int|float|bool> $config  | 
  
   
Definition at line 521 of file Config.php.
 
 
◆ $formats
  
  
      
        
          | array pocketmine\utils\Config::$formats | 
         
       
   | 
  
static   | 
  
 
Initial value:= [
        "properties" => Config::PROPERTIES,
        "cnf" => 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 93 of file Config.php.
 
 
◆ CNF
      
        
          | const pocketmine\utils\Config::CNF = Config::PROPERTIES | 
        
      
 
 
◆ DETECT
      
        
          | const pocketmine\utils\Config::DETECT = -1 | 
        
      
 
 
◆ ENUM
      
        
          | const pocketmine\utils\Config::ENUM = 5 | 
        
      
 
 
◆ ENUMERATION
      
        
          | const pocketmine\utils\Config::ENUMERATION = Config::ENUM | 
        
      
 
 
◆ JSON
      
        
          | const pocketmine\utils\Config::JSON = 1 | 
        
      
 
 
◆ PROPERTIES
      
        
          | const pocketmine\utils\Config::PROPERTIES = 0 | 
        
      
 
 
◆ SERIALIZED
      
        
          | const pocketmine\utils\Config::SERIALIZED = 4 | 
        
      
 
 
◆ YAML
      
        
          | const pocketmine\utils\Config::YAML = 2 | 
        
      
 
 
The documentation for this class was generated from the following file: