Source for file Session.php

Documentation is available at Session.php

  1. <?php
  2. /**
  3.  * Teeple2 - PHP5 Web Application Framework inspired by Seasar2
  4.  *
  5.  * PHP versions 5
  6.  *
  7.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  8.  * that is available through the world-wide-web at the following URI:
  9.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  10.  * the PHP License and are unable to obtain it through the web, please
  11.  * send a note to license@php.net so we can mail you a copy immediately.
  12.  *
  13.  * @package     teeple
  14.  * @author      Mitsutaka Sato <miztaka@gmail.com>
  15.  * @license     http://www.php.net/license/3_0.txt  PHP License 3.0
  16.  */
  17.  
  18. /**
  19.  * セッション処理を行うFilter
  20.  *
  21.  * @package     teeple.filter
  22.  */
  23. {
  24.     
  25.     /**
  26.      * @var array 
  27.      */
  28.     private $modeArray;
  29.     
  30.     /**
  31.      * コンストラクタ
  32.      *
  33.      */
  34.     public function __construct({
  35.         parent::__construct();
  36.     }
  37.  
  38.     /**
  39.      * セッション処理を行う
  40.      *
  41.      */
  42.     public function prefilter({
  43.  
  44.         $attributes $this->getAttributes();
  45.         $this->modeArray array();
  46.  
  47.         if (isset($attributes["mode"])) {
  48.             $this->modeArray explode(","$attributes["mode"]);
  49.             foreach ($this->modeArray as $key => $value{
  50.                 $this->modeArray[$keytrim($value);
  51.             }
  52.         else {
  53.             $this->modeArray["start";
  54.         }
  55.  
  56.         if (isset($attributes["name"])) {
  57.             $this->session->setName($attributes["name"]);
  58.         }
  59.         if (isset($attributes["id"])) {
  60.             $this->session->setID($attributes["id"]);
  61.         }
  62.         if (isset($attributes["savePath"])) {
  63.             $this->session->setSavePath($attributes["savePath"]);
  64.         }
  65.         if (isset($attributes["cacheLimiter"])) {
  66.             $this->session->setCacheLimiter($attributes["cacheLimiter"]);
  67.         }
  68.         if (isset($attributes["cacheExpire"])) {
  69.             $this->session->setCacheExpire($attributes["cacheExpire"]);
  70.         }
  71.         if (isset($attributes["useCookies"])) {
  72.             $this->session->setUseCookies($attributes["useCookies"]);
  73.         }
  74.         if (isset($attributes["lifetime"])) {
  75.             $this->session->setCookieLifetime($attributes["lifetime"]);
  76.         }
  77.         if (isset($attributes["path"])) {
  78.             $this->session->setCookiePath($attributes["path"]);
  79.         }
  80.         if (isset($attributes["domain"])) {
  81.             $this->session->setCookieDomain($attributes["domain"]);
  82.         }
  83.         if (isset($attributes["secure"])) {
  84.             $this->session->setCookieSecure($attributes["secure"]);
  85.         }
  86.  
  87.         if (in_array('start'$this->modeArray)) {
  88.             $this->session->start();
  89.         }
  90.         
  91.         return;
  92.     }
  93.     
  94.     /**
  95.      * セッションのクローズを行います。
  96.      *
  97.      */
  98.     public function postfilter({
  99.         if (in_array('close'$this->modeArray)) {
  100.             $this->session->close();
  101.         }
  102.         return;
  103.     }
  104. }
  105. ?>

Documentation generated on Mon, 26 Apr 2010 08:59:57 +0900 by phpDocumentor 1.4.3