X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fsession%2FPHPSessionHandler.php;h=64c2b84d8dbaea2ccd04c00787e813237c60fd7a;hp=f14e0eb7409d61c7bf36e906bb807fde6d58d4e5;hb=bd5a37aacf600bdd5f3a6e7998f92bd1d9326a8a;hpb=b8e0ca16aa743581f5fac5cef8bed5ac2bf6e7cb diff --git a/includes/session/PHPSessionHandler.php b/includes/session/PHPSessionHandler.php index f14e0eb740..64c2b84d8d 100644 --- a/includes/session/PHPSessionHandler.php +++ b/includes/session/PHPSessionHandler.php @@ -25,6 +25,7 @@ namespace MediaWiki\Session; use Psr\Log\LoggerInterface; use BagOStuff; +use Psr\Log\NullLogger; /** * Adapter for PHP's session handling @@ -41,7 +42,7 @@ class PHPSessionHandler implements \SessionHandlerInterface { /** @var bool */ protected $warn = true; - /** @var SessionManager|null */ + /** @var SessionManagerInterface|null */ protected $manager; /** @var BagOStuff|null */ @@ -53,7 +54,7 @@ class PHPSessionHandler implements \SessionHandlerInterface { /** @var array Track original session fields for later modification check */ protected $sessionFieldCache = []; - protected function __construct( SessionManager $manager ) { + protected function __construct( SessionManagerInterface $manager ) { $this->setEnableFlags( \RequestContext::getMain()->getConfig()->get( 'PHPSessionHandling' ) ); @@ -105,9 +106,9 @@ class PHPSessionHandler implements \SessionHandlerInterface { /** * Install a session handler for the current web request - * @param SessionManager $manager + * @param SessionManagerInterface $manager */ - public static function install( SessionManager $manager ) { + public static function install( SessionManagerInterface $manager ) { if ( self::$instance ) { $manager->setupPHPSessionHandler( self::$instance ); return; @@ -151,12 +152,12 @@ class PHPSessionHandler implements \SessionHandlerInterface { /** * Set the manager, store, and logger * @private Use self::install(). - * @param SessionManager $manager + * @param SessionManagerInterface $manager * @param BagOStuff $store * @param LoggerInterface $logger */ public function setManager( - SessionManager $manager, BagOStuff $store, LoggerInterface $logger + SessionManagerInterface $manager, BagOStuff $store, LoggerInterface $logger ) { if ( $this->manager !== $manager ) { // Close any existing session before we change stores @@ -299,7 +300,7 @@ class PHPSessionHandler implements \SessionHandlerInterface { } // Anything deleted in $_SESSION and unchanged in Session should be deleted too // (but not if $_SESSION can't represent it at all) - \Wikimedia\PhpSessionSerializer::setLogger( new \Psr\Log\NullLogger() ); + \Wikimedia\PhpSessionSerializer::setLogger( new NullLogger() ); foreach ( $cache as $key => $value ) { if ( !array_key_exists( $key, $data ) && $session->exists( $key ) && \Wikimedia\PhpSessionSerializer::encode( [ $key => true ] )