public function __construct($cas_parent, $redis)
 {
     parent::__construct($cas_parent);
     $this->_redis = $redis;
 }
Example #2
0
 /**
  * The class constructor, called by CAS_Client::SetPGTStorageFile().
  *
  * @param CAS_Client $cas_parent the CAS_Client instance that creates the object.
  * @param string     $path       the path where the PGT's should be stored
  *
  * @return void
  *
  * @public
  */
 function __construct($cas_parent, $path)
 {
     phpCAS::traceBegin();
     // call the ancestor's constructor
     parent::__construct($cas_parent);
     if (empty($path)) {
         $path = CAS_PGT_STORAGE_FILE_DEFAULT_PATH;
     }
     // check that the path is an absolute path
     if (getenv("OS") == "Windows_NT") {
         if (!preg_match('`^[a-zA-Z]:`', $path)) {
             phpCAS::error('an absolute path is needed for PGT storage to file');
         }
     } else {
         if ($path[0] != '/') {
             phpCAS::error('an absolute path is needed for PGT storage to file');
         }
         // store the path (with a leading and trailing '/')
         $path = preg_replace('|[/]*$|', '/', $path);
         $path = preg_replace('|^[/]*|', '/', $path);
     }
     $this->_path = $path;
     phpCAS::traceEnd();
 }
Example #3
0
 /**
  * The class constructor.
  *
  * @param CAS_Client $cas_parent     the CAS_Client instance that creates
  * the object.
  * @param string     $dsn_or_pdo     a dsn string to use for creating a PDO
  * object or a PDO object
  * @param string     $username       the username to use when connecting to
  * the database
  * @param string     $password       the password to use when connecting to
  * the database
  * @param string     $table          the table to use for storing and
  * retrieving PGT's
  * @param string     $driver_options any driver options to use when
  * connecting to the database
  */
 public function __construct($cas_parent, $dsn_or_pdo, $username = '', $password = '', $table = '', $driver_options = null)
 {
     phpCAS::traceBegin();
     // call the ancestor's constructor
     parent::__construct($cas_parent);
     // set default values
     if (empty($table)) {
         $table = CAS_PGT_STORAGE_DB_DEFAULT_TABLE;
     }
     if (!is_array($driver_options)) {
         $driver_options = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION);
     }
     // store the specified parameters
     if ($dsn_or_pdo instanceof PDO) {
         $this->_pdo = $dsn_or_pdo;
     } else {
         $this->_dsn = $dsn_or_pdo;
         $this->_username = $username;
         $this->_password = $password;
         $this->_driver_options = $driver_options;
     }
     // store the table name
     $this->_table = $table;
     phpCAS::traceEnd();
 }