コード例 #1
0
 /**
  * instantiate the postman
  *
  * @since Method available since Release 1.2.0
  */
 public function __construct()
 {
     $this->_config = SimpleSAML_Configuration::getConfig('module_janus.php');
     // Send DB config to parent class
     parent::__construct($this->_config->getValue('store'));
     $this->_paginate = $this->_config->getValue('dashboard.inbox.paginate_by', 20);
 }
コード例 #2
0
 /**
  * Creates a new administrator utility.
  *
  * @since Method available since Release 1.0.0
  */
 public function __construct()
 {
     $this->_config = SimpleSAML_Configuration::getConfig('module_janus.php');
     // Send DB config to parent class
     parent::__construct($this->_config->getValue('store'));
 }
コード例 #3
0
 /**
  * Create new entity
  *
  * Will instanciate a new entity given correct configuration. If parsed the
  * new flag, a new eid will be generated.
  *
  * @param array $config Configuration for the database
  * @param bool  $new    Is entity new, default false
  */
 public function __construct($config, $new = false)
 {
     // To start with only the store config is parsed til user
     parent::__construct($config->getValue('store'));
     $this->_config = $config;
     // If entity is new, get new eid
     if ($new) {
         $this->_getNewEid();
     }
 }
 /**
  * Class constructor.
  *
  * Constructs a EntityController object.
  *
  * @param SimpleSAML_Configuration $config Global SSP configuration
  */
 public function __construct(SimpleSAML_Configuration $config)
 {
     parent::__construct($config->getValue('store'));
     $this->_config = $config;
 }
コード例 #5
0
 /**
  * Creates a new instanse of matadata
  *
  * @param SimpleSAML_Configuration $config Configuration for JANUS
  *
  * @since Class available since Release 1.0.0
  */
 public function __construct($config)
 {
     parent::__construct($config);
 }
コード例 #6
0
 /**
  * Initiate a database connection
  *
  * If a connection have already been initiated that connection will be
  * returned.
  *
  * @return PDO|null Database handle, or null if the conection failes
  * @see PHP_MANUAL#class.pdo
  * @todo Throw exception on connection failiur.
  */
 private static function _getDB()
 {
     if (self::$db !== null) {
         return self::$db;
     }
     try {
         self::$db = new PDO(self::$_dsn, self::$_username, self::$_password);
         // Set the error reporting attribute
         self::$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
     } catch (PDOException $e) {
         self::$db = null;
         throw new SimpleSAML_Error_Exception('janus:Database - Failed to connect to \'' . self::$_dsn . '\': ' . $e->getMessage());
     }
     return self::$db;
 }