SimpleSAML_Configuration::getConfig PHP Method

getConfig() public static method

Load a configuration file from a configuration set.
public static getConfig ( string $filename = 'config.php', string $configSet = 'simplesaml' ) : SimpleSAML_Configuration
$filename string The name of the configuration file.
$configSet string The configuration set. Optional, defaults to 'simplesaml'.
return SimpleSAML_Configuration The SimpleSAML_Configuration object.
    public static function getConfig($filename = 'config.php', $configSet = 'simplesaml')
    {
        assert('is_string($filename)');
        assert('is_string($configSet)');
        if (!array_key_exists($configSet, self::$configDirs)) {
            if ($configSet !== 'simplesaml') {
                throw new Exception('Configuration set \'' . $configSet . '\' not initialized.');
            } else {
                self::$configDirs['simplesaml'] = SimpleSAML\Utils\Config::getConfigDir();
            }
        }
        $dir = self::$configDirs[$configSet];
        $filePath = $dir . '/' . $filename;
        return self::loadFromFile($filePath, true);
    }

Usage Example

コード例 #1
0
 /**
  * Delete the ARP identified by the aid.
  *
  * @return PDOStatement|false The statement or false on error.
  */
 public function delete()
 {
     if (empty($this->_aid)) {
         SimpleSAML_Logger::error('JANUS:ARP:delete - aid needs to be set.');
         return false;
     }
     $deleteStatement = $this->execute('UPDATE ' . self::$prefix . 'arp SET
         `deleted` = ?
         WHERE `aid` = ?;', array(date('c'), $this->_aid));
     if ($deleteStatement === false) {
         return false;
     }
     // Get all entities with the just removed ARP
     $st = $this->execute('SELECT eid
         FROM ' . self::$prefix . 'entity
         WHERE `arp` = ?;', array($this->_aid));
     if (!$st) {
         return $deleteStatement;
     }
     $janus_config = SimpleSAML_Configuration::getConfig('module_janus.php');
     $controller = new sspmod_janus_EntityController($janus_config);
     // Remove the ARP from all entities
     $entity_rows = $st->fetchAll();
     foreach ($entity_rows as $entity_row) {
         $controller->setEntity($entity_row['eid']);
         $controller->loadEntity();
         $controller->setArp('0');
         $controller->saveEntity();
     }
     return $deleteStatement;
 }
All Usage Examples Of SimpleSAML_Configuration::getConfig