13
13
*
14
14
* @package modx
15
15
*/
16
- class modSessionHandler {
16
+ class modSessionHandler implements SessionHandlerInterface {
17
17
/**
18
18
* @var modX A reference to the modX instance controlling this session
19
19
* handler.
@@ -60,11 +60,14 @@ function __construct(modX &$modx) {
60
60
/**
61
61
* Opens the connection for the session handler.
62
62
*
63
+ * @param $path
64
+ * @param $name
63
65
* @access public
64
66
* @return boolean Always returns true; actual connection is managed by
65
67
* {@link modX}.
66
68
*/
67
- public function open () {
69
+ #[\ReturnTypeWillChange]
70
+ public function open ($ path , $ name ) {
68
71
return true ;
69
72
}
70
73
@@ -75,6 +78,7 @@ public function open() {
75
78
* @return boolean Always returns true; actual connection is managed by
76
79
* {@link modX}
77
80
*/
81
+ #[\ReturnTypeWillChange]
78
82
public function close () {
79
83
return true ;
80
84
}
@@ -86,6 +90,7 @@ public function close() {
86
90
* @param integer $id The pk of the {@link modSession} object.
87
91
* @return string The data read from the {@link modSession} object.
88
92
*/
93
+ #[\ReturnTypeWillChange]
89
94
public function read ($ id ) {
90
95
if ($ this ->_getSession ($ id )) {
91
96
$ data = $ this ->session ->get ('data ' );
@@ -103,6 +108,7 @@ public function read($id) {
103
108
* @param mixed $data The data to write to the session.
104
109
* @return boolean True if successfully written.
105
110
*/
111
+ #[\ReturnTypeWillChange]
106
112
public function write ($ id , $ data ) {
107
113
$ written = false ;
108
114
if ($ this ->_getSession ($ id , true )) {
@@ -122,6 +128,7 @@ public function write($id, $data) {
122
128
* @param integer $id
123
129
* @return boolean True if the session record was destroyed.
124
130
*/
131
+ #[\ReturnTypeWillChange]
125
132
public function destroy ($ id ) {
126
133
if ($ this ->_getSession ($ id )) {
127
134
$ destroyed = $ this ->session ->remove ();
@@ -139,6 +146,7 @@ public function destroy($id) {
139
146
* longer than.
140
147
* @return boolean True if session records were removed.
141
148
*/
149
+ #[\ReturnTypeWillChange]
142
150
public function gc ($ max ) {
143
151
$ maxtime = time () - $ this ->gcMaxLifetime ;
144
152
return $ this ->modx ->removeCollection ('modSession ' , array ("{$ this ->modx ->escape ('access ' )} < {$ maxtime }" ));
0 commit comments