public function __construct(\SimpleSAML_Configuration $config) { parent::__construct($config); $storeConfig = $config->getValue('ticketstore'); if (array_key_exists('prefix', $storeConfig)) { $this->prefix = $storeConfig['prefix']; } }
public function __construct(\SimpleSAML_Configuration $config) { parent::__construct($config); $storeConfig = $config->getValue('ticketstore'); $dsn = $storeConfig['dsn']; $username = $storeConfig['username']; $password = $storeConfig['password']; $this->prefix = $storeConfig['prefix']; $this->pdo = new PDO($dsn, $username, $password); $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $this->driver = $this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME); if ($this->driver === 'mysql') { $this->pdo->exec('SET time_zone = "+00:00"'); } $this->initTableVersionTable(); $this->initKVTable(); }