Provides for encoding and decoding session arrays to PHP's serialization formats.
More...
|
static | setLogger (LoggerInterface $logger) |
| Set the logger to which to log.
|
|
static | setSerializeHandler () |
| Try to set session.serialize_handler to a supported format.
|
|
static | encode (array $data) |
| Encode a session array to a string, using the format in session.serialize_handler.
|
|
static | decode ( $data) |
| Decode a session string to an array, using the format in session.serialize_handler.
|
|
static | encodePhp (array $data) |
| Encode a session array to a string in 'php' format.
|
|
static | decodePhp ( $data) |
| Decode a session string in 'php' format to an array.
|
|
static | encodePhpBinary (array $data) |
| Encode a session array to a string in 'php_binary' format.
|
|
static | decodePhpBinary ( $data) |
| Decode a session string in 'php_binary' format to an array.
|
|
static | encodePhpSerialize (array $data) |
| Encode a session array to a string in 'php_serialize' format.
|
|
static | decodePhpSerialize ( $data) |
| Decode a session string in 'php_serialize' format to an array.
|
|
Provides for encoding and decoding session arrays to PHP's serialization formats.
Supported formats are:
- php
- php_binary
- php_serialize
WDDX is not supported, since it breaks on all sorts of things.
◆ decode()
static Wikimedia\PhpSessionSerializer::decode |
( |
| $data | ) |
|
|
static |
Decode a session string to an array, using the format in session.serialize_handler.
- Parameters
-
string | $data | Session data. Use the same caution in passing user-controlled data here that you would to PHP's unserialize function. |
- Returns
- array|null Data, or null on failure
- Exceptions
-
DomainException | |
InvalidArgumentException | |
◆ decodePhp()
static Wikimedia\PhpSessionSerializer::decodePhp |
( |
| $data | ) |
|
|
static |
Decode a session string in 'php' format to an array.
- Note
- Generally you'll use self::decode() instead of this method.
- Parameters
-
string | $data | Session data. Use the same caution in passing user-controlled data here that you would to PHP's unserialize function. |
- Returns
- array|null Data, or null on failure
- Exceptions
-
◆ decodePhpBinary()
static Wikimedia\PhpSessionSerializer::decodePhpBinary |
( |
| $data | ) |
|
|
static |
Decode a session string in 'php_binary' format to an array.
- Note
- Generally you'll use self::decode() instead of this method.
- Parameters
-
string | $data | Session data. Use the same caution in passing user-controlled data here that you would to PHP's unserialize function. |
- Returns
- array|null Data, or null on failure
- Exceptions
-
◆ decodePhpSerialize()
static Wikimedia\PhpSessionSerializer::decodePhpSerialize |
( |
| $data | ) |
|
|
static |
Decode a session string in 'php_serialize' format to an array.
- Note
- Generally you'll use self::decode() instead of this method.
- Parameters
-
string | $data | Session data. Use the same caution in passing user-controlled data here that you would to PHP's unserialize function. |
- Returns
- array|null Data, or null on failure
- Exceptions
-
◆ encode()
static Wikimedia\PhpSessionSerializer::encode |
( |
array | $data | ) |
|
|
static |
Encode a session array to a string, using the format in session.serialize_handler.
- Parameters
-
- Returns
- string|null Encoded string, or null on failure
- Exceptions
-
◆ encodePhp()
static Wikimedia\PhpSessionSerializer::encodePhp |
( |
array | $data | ) |
|
|
static |
Encode a session array to a string in 'php' format.
- Note
- Generally you'll use self::encode() instead of this method.
- Parameters
-
- Returns
- string|null Encoded string, or null on failure
◆ encodePhpBinary()
static Wikimedia\PhpSessionSerializer::encodePhpBinary |
( |
array | $data | ) |
|
|
static |
Encode a session array to a string in 'php_binary' format.
- Note
- Generally you'll use self::encode() instead of this method.
- Parameters
-
- Returns
- string|null Encoded string, or null on failure
◆ encodePhpSerialize()
static Wikimedia\PhpSessionSerializer::encodePhpSerialize |
( |
array | $data | ) |
|
|
static |
Encode a session array to a string in 'php_serialize' format.
- Note
- Generally you'll use self::encode() instead of this method.
- Parameters
-
- Returns
- string|null Encoded string, or null on failure
◆ setLogger()
static Wikimedia\PhpSessionSerializer::setLogger |
( |
LoggerInterface | $logger | ) |
|
|
static |
Set the logger to which to log.
- Parameters
-
LoggerInterface | $logger | The logger |
◆ setSerializeHandler()
static Wikimedia\PhpSessionSerializer::setSerializeHandler |
( |
| ) |
|
|
static |
Try to set session.serialize_handler to a supported format.
This may change the format even if the current format is also supported.
- Returns
- string Format set
- Exceptions
-
The documentation for this class was generated from the following file: