SimpleSAML_Configuration::setConfigDir PHP Method

setConfigDir() public static method

Set the directory for configuration files for the given configuration set.
public static setConfigDir ( string $path, string $configSet = 'simplesaml' )
$path string The directory which contains the configuration files.
$configSet string The configuration set. Defaults to 'simplesaml'.
    public static function setConfigDir($path, $configSet = 'simplesaml')
    {
        assert('is_string($path)');
        assert('is_string($configSet)');
        self::$configDirs[$configSet] = $path;
    }

Usage Example

コード例 #1
0
 /**
  * Constructor
  *
  * Note that the person is tied to a OAuth datastore here
  */
 function __construct($person = NULL)
 {
     parent::__construct($person);
     /* Find the path to simpelsamlphp and run the autoloader */
     try {
         $sspdir = Config::get_config('simplesaml_path');
     } catch (KeyNotFoundException $knfe) {
         echo "Cannot find path to simplesaml. This install is not valid. Aborting.<br />\n";
         Logger::log_event(LOG_ALERT, "Trying to instantiate simpleSAMLphp without a configured path.");
         exit(0);
     }
     require_once $sspdir . '/lib/_autoload.php';
     SimpleSAML_Configuration::setConfigDir($sspdir . '/config');
     $this->oauthStore = new OAuthDataStore_Confusa();
     $this->oauthServer = new sspmod_oauth_OAuthServer($this->oauthStore);
     $hmac_method = new OAuthSignatureMethod_HMAC_SHA1();
     $this->oauthServer->add_signature_method($hmac_method);
     $req = OAuthRequest::from_request();
     list($consumer, $this->accessToken) = $this->oauthServer->verify_request($req);
     $this->isAuthenticated = isset($this->accessToken);
 }
All Usage Examples Of SimpleSAML_Configuration::setConfigDir