pocketmine\permission\BanList::save PHP Method

save() public method

public save ( $flag = true )
    public function save($flag = true)
    {
        $this->removeExpired();
        $fp = @fopen($this->file, "w");
        if (is_resource($fp)) {
            if ($flag === true) {
                fwrite($fp, "# Updated " . strftime("%x %H:%M", time()) . " by " . Server::getInstance()->getName() . " " . Server::getInstance()->getPocketMineVersion() . "\n");
                fwrite($fp, "# victim name | ban date | banned by | banned until | reason\n\n");
            }
            foreach ($this->list as $entry) {
                fwrite($fp, $entry->getString() . "\n");
            }
            fclose($fp);
        } else {
            MainLogger::getLogger()->error("Could not save ban list");
        }
    }