pocketmine\Server::getConfigBoolean PHP Method

getConfigBoolean() public method

public getConfigBoolean ( string $variable, boolean $defaultValue = false ) : boolean
$variable string
$defaultValue boolean
return boolean
    public function getConfigBoolean($variable, $defaultValue = false)
    {
        $v = getopt("", ["{$variable}::"]);
        if (isset($v[$variable])) {
            $value = $v[$variable];
        } else {
            $value = $this->properties->exists($variable) ? $this->properties->get($variable) : $defaultValue;
        }
        if (is_bool($value)) {
            return $value;
        }
        switch (strtolower($value)) {
            case "on":
            case "true":
            case "1":
            case "yes":
                return true;
        }
        return false;
    }
Server