setPGTStorageFile() 공개 메소드

This method is used to tell phpCAS to store the response of the CAS server to PGT requests onto the filesystem.
public setPGTStorageFile ( string $path = '' ) : void
$path string the path where the PGT's should be stored
리턴 void
 private function initializeCAS()
 {
     $casClient = new \CAS_Client(CAS_VERSION_2_0, true, Config::get('cas.hostname'), Config::get('cas.port'), Config::get('cas.context'));
     $casClient->setNoCasServerValidation();
     if (true === Config::get('pgtservice.enabled', false)) {
         $casClient->setCallbackURL(Config::get('pgtservice.callback'));
         $casClient->setPGTStorage(new ProxyTicketServiceStorage($casClient));
     } else {
         if (false !== Config::get('redis.hostname', false)) {
             $casClient->setCallbackURL($this->url->getURL() . '/callback.php');
             $redis = new \Redis();
             $redis->connect(Config::get('redis.hostname'), Config::get('redis.port', 6379), 2, null, 100);
             $redis->setOption(\Redis::OPT_SERIALIZER, \Redis::SERIALIZER_PHP);
             $redis->setOption(\Redis::OPT_PREFIX, Config::get('application.project_name') . ':PHPCAS_TICKET_STORAGE:');
             $redis->select((int) Config::get('redis.hostname', 2));
             $casClient->setPGTStorage(new RedisTicketStorage($casClient, $redis));
         } else {
             $casClient->setCallbackURL($this->url->getURL() . '/callback.php');
             $casClient->setPGTStorageFile(session_save_path());
             // Handle logout requests but do not validate the server
             $casClient->handleLogoutRequests(false);
         }
     }
     // Accept all proxy chains
     $casClient->getAllowedProxyChains()->allowProxyChain(new \CAS_ProxyChain_Any());
     return $casClient;
 }
예제 #2
0
파일: CAS.php 프로젝트: DCUnit711/Demeter
 /**
  * This method is used to tell phpCAS to store the response of the
  * CAS server to PGT requests onto the filesystem.
  *
  * @param string $path the path where the PGT's should be stored
  *
  * @return void
  */
 public static function setPGTStorageFile($path = '')
 {
     phpCAS::traceBegin();
     phpCAS::_validateProxyExists();
     try {
         self::$_PHPCAS_CLIENT->setPGTStorageFile($path);
     } catch (Exception $e) {
         phpCAS::error(get_class($e) . ': ' . $e->getMessage());
     }
     phpCAS::traceEnd();
 }