Ejemplo n.º 1
0
function getStateManager()
{
    $session = \UserlandSession\SessionBuilder::instance()->setSavePath(sys_get_temp_dir())->setName('SHIBALIKE_BASIC')->build();
    return new \Shibalike\StateManager\UserlandSession($session);
}
Ejemplo n.º 2
0
 /**
  * Creates an SP that stores session data in files
  * @param string $idpUrl URL where the IdP class is used to handle SP auth requests
  * @param string $cookieName
  * @param string $sessionPath path where session files are stored
  * @return SP|false false if a UserlandSession already exists under this cookie name
  */
 public static function createFileBased($idpUrl, $cookieName = 'SHIBALIKE', $sessionPath = null)
 {
     if (empty($sessionPath)) {
         $sessionPath = sys_get_temp_dir();
     }
     $session = SessionBuilder::instance()->setName($cookieName)->setSavePath($sessionPath)->build();
     $stateMgr = new UserlandSessionStateMgr($session);
     $config = new Config();
     $config->idpUrl = $idpUrl;
     return new self($stateMgr, $config);
 }