Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezpsessionhandlersymfony.php
Go to the documentation of this file.
1 <?php
20 class ezpSessionHandlerSymfony extends ezpSessionHandler
21 {
25 protected $storage;
26
30 public function setSaveHandler()
31 {
32 // make sure eZUser does not update lastVisit on every request and only on login
33 $GLOBALS['eZSessionIdleTime'] = 0;
34 return true;
35 }
36
37 public function read( $sessionId )
38 {
39 return false;
40 }
41
42 public function write( $sessionId, $sessionData )
43 {
44 return false;
45 }
46
47 public function destroy( $sessionId )
48 {
49 if ( eZSys::isShellExecution() )
50 {
51 return false;
52 }
53
54 $sfHandler = $this->storage->getSaveHandler();
55 ezpEvent::getInstance()->notify( 'session/destroy', array( $sessionId ) );
56 if ( method_exists( $sfHandler, 'destroy' ) )
57 {
58 return $sfHandler->destroy( $sessionId );
59 }
60 return false;
61 }
62
63 public function regenerate( $updateBackendData = true )
64 {
65 if ( eZSys::isShellExecution() )
66 {
67 return false;
68 }
69
70 $oldSessionId = session_id();
71 $this->storage->regenerate( $updateBackendData );
72 $newSessionId = session_id();
73
74 ezpEvent::getInstance()->notify( 'session/regenerate', array( $oldSessionId, $newSessionId ) );
75
76 if ( $updateBackendData )
77 {
78 $db = eZDB::instance();
79 $escOldKey = $db->escapeString( $oldSessionId );
80 $escNewKey = $db->escapeString( $newSessionId );
81 $escUserID = $db->escapeString( eZSession::userID() );
82 eZSession::triggerCallback( 'regenerate_pre', array( $db, $escNewKey, $escOldKey, $escUserID ) );
83 eZSession::triggerCallback( 'regenerate_post', array( $db, $escNewKey, $escOldKey, $escUserID ) );
84 }
85 return true;
86 }
87
88 public function gc( $maxLifeTime )
89 {
90 if ( eZSys::isShellExecution() )
91 {
92 return false;
93 }
94
95 ezpEvent::getInstance()->notify( 'session/gc', array( $maxLifeTime ) );
96 $db = eZDB::instance();
97 eZSession::triggerCallback( 'gc_pre', array( $db, $maxLifeTime ) );
98 $sfHandler = $this->storage->getSaveHandler();
99 if ( method_exists( $sfHandler, 'gc' ) )
100 {
101 $sfHandler->gc( $maxLifeTime );
102 }
103 eZSession::triggerCallback( 'gc_post', array( $db, $maxLifeTime ) );
104 return false;
105 }
106
107 public function cleanup()
108 {
109
110 }
111
112 public function deleteByUserIDs( array $userIDArray )
113 {
114 }
115
116 static public function count()
117 {
118 return -1;
119 }
120
121 static public function hasBackendAccess()
122 {
123
124 }
125
126 static public function dbRequired()
127 {
128 return false;
129 }
130
136 public function setStorage( $storage )
137 {
138 $this->storage = $storage;
139 }
140
146 public function sessionStart()
147 {
148 if ( $this->storage && !$this->storage->isStarted() )
149 {
150 $this->storage->start();
151 }
152
153 return true;
154 }
155 }
eZSession\userID
static userID()
Definition: lib/ezsession/classes/ezsession.php:547
eZSession\triggerCallback
static triggerCallback( $type, $params)
Definition: lib/ezsession/classes/ezsession.php:641
eZSys\isShellExecution
static isShellExecution()
Definition: ezsys.php:266
ezpEvent\getInstance
static getInstance()
Definition: ezpevent.php:176
ezpSessionHandlerSymfony
Definition: ezpsessionhandlersymfony.php:21
ezpSessionHandlerSymfony\setSaveHandler
setSaveHandler()
Definition: ezpsessionhandlersymfony.php:30
ezpSessionHandlerSymfony\$storage
$storage
Definition: ezpsessionhandlersymfony.php:25
ezpSessionHandlerSymfony\dbRequired
static dbRequired()
Definition: ezpsessionhandlersymfony.php:126
ezpSessionHandlerSymfony\write
write( $sessionId, $sessionData)
Definition: ezpsessionhandlersymfony.php:42
ezpSessionHandlerSymfony\count
static count()
Definition: ezpsessionhandlersymfony.php:116
ezpSessionHandlerSymfony\deleteByUserIDs
deleteByUserIDs(array $userIDArray)
Definition: ezpsessionhandlersymfony.php:112
ezpSessionHandlerSymfony\sessionStart
sessionStart()
Definition: ezpsessionhandlersymfony.php:146
ezpSessionHandlerSymfony\read
read( $sessionId)
Definition: ezpsessionhandlersymfony.php:37
ezpSessionHandlerSymfony\destroy
destroy( $sessionId)
Definition: ezpsessionhandlersymfony.php:47
ezpSessionHandlerSymfony\setStorage
setStorage( $storage)
Definition: ezpsessionhandlersymfony.php:136
ezpSessionHandlerSymfony\hasBackendAccess
static hasBackendAccess()
Definition: ezpsessionhandlersymfony.php:121
ezpSessionHandlerSymfony\gc
gc( $maxLifeTime)
Definition: ezpsessionhandlersymfony.php:88
ezpSessionHandlerSymfony\cleanup
cleanup()
Definition: ezpsessionhandlersymfony.php:107
ezpSessionHandlerSymfony\regenerate
regenerate( $updateBackendData=true)
Definition: ezpsessionhandlersymfony.php:63
ezpSessionHandler
Definition: ezpsessionhandler.php:26
$db
$db
Definition: ezarticle/user/authorlist.php:53
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.