public function createFromFile($file)
    {
        // Check if the file exists
        if (!$file || !file_exists($file)) {
            throw new \Exception("Configuration file \"{$file}\" could not be found.");
        }

        // Include the file while suppressing warnings
        // - so we can check if we could include it
        $config = @include($file);
        if (!$config) {
            throw new \Exception("Configuration file \"{$file}\" could not be included.");
        }

        // Set the properties
        $this->useAuthorization = $config['useAuthorization'];
        $this->authorizationMode = $config['authorizationMode'];
        $this->redirectAuthorization = $config['redirectAuthorization'];
        $this->authorizationForm = $config['authorizationForm'];
        $this->dsn = $config['dsn'];
        $this->username = $config['username'];
        $this->password = $config['password'];
        $this->responseType = $config['responseType'];
        $this->clientResponseType = $config['clientResponseType'];
        return $this;
    }