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()
6767 SessionManagerTest::$ isSessionSetSaveHandlerInvoked = true ;
6868 return true ;
6969 }
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 );
7181 }
7282
7383 /**
Original file line number Diff line number Diff line change @@ -258,12 +258,8 @@ private function renewCookie($sid)
258258 protected function registerSaveHandler ()
259259 {
260260 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
267263 );
268264 }
269265
You can’t perform that action at this time.
0 commit comments