pocketmine\utils\Config::reload PHP Method

reload() public method

Removes all the changes in memory and loads the file again
public reload ( )
    public function reload()
    {
        $this->config = [];
        $this->nestedCache = [];
        $this->correct = false;
        $this->load($this->file, $this->type);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @param PPGroup $group
  * @param $nameTag
  * @param null $levelName
  * @return bool
  */
 public function setOriginalNametag(PPGroup $group, $nameTag, $levelName = null)
 {
     if ($levelName === null) {
         $this->config->setNested("groups." . $group->getName() . ".nametag", $nameTag);
     } else {
         $this->config->setNested("groups." . $group->getName() . "worlds.{$levelName}.nametag", $nameTag);
     }
     $this->config->save();
     $this->config->reload();
     return true;
 }
All Usage Examples Of pocketmine\utils\Config::reload