public static function fromString($json, $directory = ".") {
        $json = json_decode($json, true);
        if (is_null($json))
            throw new SettingsException("invalid json");
        return new static($json, $directory);
    }
public static function fromString($json, $directory = ".") {
        $json = json_decode($json, true);
        if (is_null($json))
            throw new SettingsException("invalid json");
        return new static($json, $directory);
    }
public static function fromString ( $ json , $ directory = "." ) { $ json = json_decode ( $ json , true ) ; if ( is_null ( $ json ) ) throw new SettingsException ( "invalid json" ) ; return new static ( $ json , $ directory ) ; }
Creates settings from a JSON-encoded string.
@param string $json
@param string $directory the directory the settings apply to
@return Settings
Creates settings from a JSON - encoded string .