Exemple #1
0
 /**
  * This method is used to initialize the storage. Halts on error.
  */
 public function init()
 {
     phpCAS::traceBegin();
     // if the storage has already been initialized, return immediatly
     if ($this->isInitialized()) {
         return;
     }
     // initialize the base object
     parent::init();
     // create the PDO object if it doesn't exist already
     if (!$this->_pdo instanceof PDO) {
         try {
             $this->_pdo = new PDO($this->_dsn, $this->_username, $this->_password, $this->_driver_options);
         } catch (PDOException $e) {
             phpCAS::error('Database connection error: ' . $e->getMessage());
         }
     }
     phpCAS::traceEnd();
 }
Exemple #2
0
 /**
  * This method is used to initialize the storage. Halts on error.
  *
  * @public
  */
 function init()
 {
     phpCAS::traceBegin();
     // if the storage has already been initialized, return immediatly
     if ($this->isInitialized()) {
         return;
     }
     // call the ancestor's method (mark as initialized)
     parent::init();
     phpCAS::traceEnd();
 }