File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed
dev/tests/integration/testsuite/Magento/Framework/Session
lib/internal/Magento/Framework/Session Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,17 @@ function session_set_save_handler()
67
67
SessionManagerTest::$ isSessionSetSaveHandlerInvoked = true ;
68
68
return true ;
69
69
}
70
- return call_user_func_array ('\session_set_save_handler ' , func_get_args ());
70
+
71
+ $ args = func_get_args ();
72
+
73
+ if (count ($ args ) === 1 && $ args [0 ] instanceof \SessionHandlerInterface) {
74
+ // PHP 8.4+ single argument case
75
+ return \session_set_save_handler ($ args [0 ], true );
76
+ } elseif (count ($ args ) === 2 && $ args [0 ] instanceof \SessionHandlerInterface && is_bool ($ args [1 ])) {
77
+ // PHP 8.4+ two arguments case
78
+ return \session_set_save_handler ($ args [0 ], $ args [1 ]);
79
+ }
80
+ return call_user_func_array ('\session_set_save_handler ' , $ args );
71
81
}
72
82
73
83
/**
Original file line number Diff line number Diff line change @@ -258,12 +258,8 @@ private function renewCookie($sid)
258
258
protected function registerSaveHandler ()
259
259
{
260
260
return session_set_save_handler (
261
- [$ this ->saveHandler , 'open ' ],
262
- [$ this ->saveHandler , 'close ' ],
263
- [$ this ->saveHandler , 'read ' ],
264
- [$ this ->saveHandler , 'write ' ],
265
- [$ this ->saveHandler , 'destroy ' ],
266
- [$ this ->saveHandler , 'gc ' ]
261
+ $ this ->saveHandler ,
262
+ true
267
263
);
268
264
}
269
265
You can’t perform that action at this time.
0 commit comments