@@ -41,7 +41,7 @@ class YiiBase
4141 private static $ _logger ;
4242 public static function getVersion ()
4343 {
44- return '1.1.32-dev ' ;
44+ return '1.1.32 ' ;
4545 }
4646 public static function createWebApplication ($ config =null )
4747 {
@@ -539,6 +539,7 @@ public static function registerAutoloader($callback, $append=false)
539539 'CHttpCookie ' => '/web/CHttpCookie.php ' ,
540540 'CHttpRequest ' => '/web/CHttpRequest.php ' ,
541541 'CHttpSession ' => '/web/CHttpSession.php ' ,
542+ 'CHttpSessionHandler ' => '/web/CHttpSessionHandler.php ' ,
542543 'CHttpSessionIterator ' => '/web/CHttpSessionIterator.php ' ,
543544 'COutputEvent ' => '/web/COutputEvent.php ' ,
544545 'CPagination ' => '/web/CPagination.php ' ,
@@ -4657,7 +4658,28 @@ public function getUseCustomStorage()
46574658 public function open ()
46584659 {
46594660 if ($ this ->getUseCustomStorage ())
4660- @session_set_save_handler (array ($ this ,'openSession ' ),array ($ this ,'closeSession ' ),array ($ this ,'readSession ' ),array ($ this ,'writeSession ' ),array ($ this ,'destroySession ' ),array ($ this ,'gcSession ' ));
4661+ {
4662+ // PHP 8.4+ deprecates callback-style session_set_save_handler().
4663+ // Use object-style handler on PHP 7.0+ to avoid deprecation.
4664+ // CHttpSessionHandler is in a separate file to avoid parse errors on PHP 5.3
4665+ // where SessionHandlerInterface doesn't exist.
4666+ if (version_compare (PHP_VERSION , '7.0 ' , '>= ' ))
4667+ {
4668+ require_once (dirname (__FILE__ ) . '/CHttpSessionHandler.php ' );
4669+ @session_set_save_handler (new CHttpSessionHandler ($ this ), true );
4670+ }
4671+ else
4672+ {
4673+ @session_set_save_handler (
4674+ array ($ this , 'openSession ' ),
4675+ array ($ this , 'closeSession ' ),
4676+ array ($ this , 'readSession ' ),
4677+ array ($ this , 'writeSession ' ),
4678+ array ($ this , 'destroySession ' ),
4679+ array ($ this , 'gcSession ' )
4680+ );
4681+ }
4682+ }
46614683 @session_start ();
46624684 if (YII_DEBUG && session_id ()=='' )
46634685 {
0 commit comments