Go to the documentation of this file.
26 use Psr\Log\LoggerAwareInterface;
27 use Psr\Log\LoggerInterface;
174 'persisted' =>
false,
202 public function mergeMetadata( array $savedMetadata, array $providedMetadata ) {
203 foreach ( $providedMetadata as $k => $v ) {
204 if ( array_key_exists( $k, $savedMetadata ) && $savedMetadata[$k] !== $v ) {
207 'old_value' => $savedMetadata[$k],
213 return $providedMetadata;
376 throw new \BadMethodCallException(
377 __METHOD__ .
' must be implemented when canChangeUser() is false'
447 throw new \InvalidArgumentException(
'Backend\'s provider isn\'t $this' );
461 return static::class;
481 'sessionprovider-' . str_replace(
'\\',
'-', strtolower( static::class ) )
487 $msg->inLanguage(
$lang );
488 if ( $msg->isDisabled() ) {
489 $msg =
wfMessage(
'sessionprovider-generic', (
string)$this )->inLanguage(
$lang );
491 return $msg->plain();
512 if ( !is_string( $data ) ) {
513 throw new \InvalidArgumentException(
514 '$data must be a string, ' . gettype( $data ) .
' was passed'
517 if ( $key !==
null && !is_string( $key ) ) {
518 throw new \InvalidArgumentException(
519 '$key must be a string or null, ' . gettype( $key ) .
' was passed'
523 $hash =
\MWCryptHash::hmac(
"$this\n$data", $key ?: $this->config->get(
'SecretKey' ), false );
524 if ( strlen( $hash ) < 32 ) {
527 throw new \UnexpectedValueException(
'Hash function returned less than 128 bits' );
530 if ( strlen( $hash ) >= 40 ) {
531 $hash = \Wikimedia\base_convert( $hash, 16, 32, 32 );
533 return substr( $hash, -32 );
static hmac( $data, $key, $raw=true)
Generate an acceptably unstable one-way-hmac of some text making use of the best hash algorithm that ...
if(!isset( $args[0])) $lang
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Interface for configuration instances.
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Internationalisation code.