1 | <?php |
||
13 | class Session |
||
14 | { |
||
15 | use Injector; |
||
16 | |||
17 | /** セッション名 */ |
||
18 | const SESSION_NAME = 'WSSESS'; |
||
19 | /** 初回起動チェッククッキー名 */ |
||
20 | const INITIAL_STARTED_COOKIE_NAME = 'WSSESS_STARTED'; |
||
21 | /** セッション有効期限を保存するクッキー名 */ |
||
22 | const SESSION_EXPIRE_COOKIE_NAME = 'WSSESS_LIFE'; |
||
23 | |||
24 | /** |
||
25 | * コンストラクタ |
||
26 | * @param int セッションの有効期限(秒) |
||
27 | * @param string Cookieを有効にするパス |
||
28 | * @param string Cookieを有効にするドメイン |
||
29 | * @param boolean Secure属性を有効にする |
||
30 | * @param boolean HttpOnly属性を有効にする |
||
31 | */ |
||
32 | public function __construct($expire = null, $path = '/', $domain = "", $secure = false, $httpOnly = false) |
||
36 | |||
37 | /** |
||
38 | * デストラクタ |
||
39 | */ |
||
40 | public function __destruct() |
||
44 | |||
45 | /** |
||
46 | * 初期設定 |
||
47 | * @param integer セッションの有効期限(秒) |
||
48 | * @param string Cookieを有効にするパス |
||
49 | * @param string Cookieを有効にするドメイン |
||
50 | * @param boolean Secure属性を有効にする |
||
51 | * @param boolean HttpOnly属性を有効にする |
||
52 | */ |
||
53 | private function initialize($expire, $path, $domain, $secure, $httpOnly) |
||
83 | |||
84 | /** |
||
85 | * セッションを開始する |
||
86 | */ |
||
87 | public function start() |
||
113 | |||
114 | /** |
||
115 | * セッションを再始動する |
||
116 | * @param integer セッションの有効期限(秒) |
||
117 | * @param string Cookieを有効にするパス |
||
118 | * @param string Cookieを有効にするドメイン |
||
119 | * @param boolean Secure属性を有効にする |
||
120 | * @param boolean HttpOnly属性を有効にする |
||
121 | */ |
||
122 | public function restart($expire = null, $path = '/', $domain = '', $secure = false, $httpOnly = false) |
||
133 | |||
134 | /** |
||
135 | * 初回起動時に生成するCookieを設定する |
||
136 | */ |
||
137 | private function createInitializeCookie() |
||
142 | |||
143 | /** |
||
144 | * セッションタイムアウト状態かどうか |
||
145 | * WSSESS_LIFEクッキーが送られてこない場合、セッションタイムアウトとする |
||
146 | * @return boolean セッションタイムアウトかどうか |
||
147 | */ |
||
148 | private function isSessionTimeout() |
||
153 | |||
154 | /** |
||
155 | * 初回起動時かどうか |
||
156 | * WSSESS_STARTEDクッキーが削除されていた場合は強制的に初期化扱いする |
||
157 | * @return boolean 初回起動時かどうか |
||
158 | */ |
||
159 | private function isInitialStart() |
||
163 | |||
164 | /** |
||
165 | * セッションおよびCookieを破棄する |
||
166 | */ |
||
167 | public function destroy() |
||
177 | |||
178 | /** |
||
179 | * セッションIDを返却する |
||
180 | * @return string セッションID |
||
181 | */ |
||
182 | public function id() |
||
186 | |||
187 | /** |
||
188 | * セッションをセットする |
||
189 | * @param string セッションキー |
||
190 | * @param string セッション値 |
||
191 | */ |
||
192 | public function set($name, $value) |
||
196 | |||
197 | /** |
||
198 | * セッションを破棄する |
||
199 | * @param string セッションキー |
||
200 | */ |
||
201 | public function delete($key) |
||
205 | |||
206 | /** |
||
207 | * セッションを取得する |
||
208 | * @param string セッションキー |
||
209 | * @return string セッション値 |
||
210 | */ |
||
211 | public function get($name) |
||
217 | |||
218 | /** |
||
219 | * セッションタイムアウトしたか返却する |
||
220 | * @return boolean セッションタイムアウトしたかどうか |
||
221 | */ |
||
222 | public function timeout() |
||
226 | } |
||
227 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.