X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fsession%2FSessionManager.php;h=603985f50bb79ebe951d75cccd6b01aaa108a577;hb=d8ce984944939c2fd17f4676fc6f6ccf1a1222e2;hp=7cc85094861810fb1f45f57560ca1c8b5d0904cf;hpb=ef1f66b2351ce726ba8da21c3c7db290c31e0b37;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/session/SessionManager.php b/includes/session/SessionManager.php index 7cc8509486..603985f50b 100644 --- a/includes/session/SessionManager.php +++ b/includes/session/SessionManager.php @@ -32,6 +32,7 @@ use Config; use FauxRequest; use User; use WebRequest; +use Wikimedia\ObjectFactory; /** * This serves as the entry point to the MediaWiki session handling system. @@ -214,7 +215,7 @@ final class SessionManager implements SessionManagerInterface { } // Test if the session is in storage, and if so try to load it. - $key = wfMemcKey( 'MWSession', $id ); + $key = $this->store->makeKey( 'MWSession', $id ); if ( is_array( $this->store->get( $key ) ) ) { $create = false; // If loading fails, don't bother creating because it probably will fail too. if ( $this->loadSessionInfoFromStore( $info, $request ) ) { @@ -255,7 +256,7 @@ final class SessionManager implements SessionManagerInterface { throw new \InvalidArgumentException( 'Invalid session ID' ); } - $key = wfMemcKey( 'MWSession', $id ); + $key = $this->store->makeKey( 'MWSession', $id ); if ( is_array( $this->store->get( $key ) ) ) { throw new \InvalidArgumentException( 'Session ID already exists' ); } @@ -429,7 +430,7 @@ final class SessionManager implements SessionManagerInterface { if ( $this->sessionProviders === null ) { $this->sessionProviders = []; foreach ( $this->config->get( 'SessionProviders' ) as $spec ) { - $provider = \ObjectFactory::getObjectFromSpec( $spec ); + $provider = ObjectFactory::getObjectFromSpec( $spec ); $provider->setLogger( $this->logger ); $provider->setConfig( $this->config ); $provider->setManager( $this ); @@ -545,7 +546,7 @@ final class SessionManager implements SessionManagerInterface { * @return bool Whether the session info matches the stored data (if any) */ private function loadSessionInfoFromStore( SessionInfo &$info, WebRequest $request ) { - $key = wfMemcKey( 'MWSession', $info->getId() ); + $key = $this->store->makeKey( 'MWSession', $info->getId() ); $blob = $this->store->get( $key ); // If we got data from the store and the SessionInfo says to force use, @@ -934,7 +935,7 @@ final class SessionManager implements SessionManagerInterface { public function generateSessionId() { do { $id = \Wikimedia\base_convert( \MWCryptRand::generateHex( 40 ), 16, 32, 32 ); - $key = wfMemcKey( 'MWSession', $id ); + $key = $this->store->makeKey( 'MWSession', $id ); } while ( isset( $this->allSessionIds[$id] ) || is_array( $this->store->get( $key ) ) ); return $id; }