Portability | portable |
---|---|
Stability | experimental |
Maintainer | Edward L. Blake <edwardlblake@gmail.com> |
Safe Haskell | Safe-Inferred |
Types used for representing PHP data types from encoding and decoding a PHP session.
- type PHPSessionVariableList = [(ByteString, PHPSessionValue)]
- data PHPSessionClassName = PHPSessionClassName ByteString
- data PHPSessionValue
- = PHPSessionValueArray [(PHPSessionValue, PHPSessionValue)]
- | PHPSessionValueBool Bool
- | PHPSessionValueFloat (Either Int Double)
- | PHPSessionValueInt Int
- | PHPSessionValueNull
- | PHPSessionValueObject PHPSessionClassName [(PHPSessionValue, PHPSessionValue)]
- | PHPSessionValueObjectSerializeable PHPSessionClassName ByteString
- | PHPSessionValueString ByteString
- | PHPSessionValueMisc ByteString [PHPSessionAttr]
- data PHPSessionAttr
- = PHPSessionAttrInt Int
- | PHPSessionAttrFloat Double
- | PHPSessionAttrNested [PHPSessionValue]
- data PHPSessionDecodingError
- = PHPSessionStringEmpty
- | PHPSessionCouldntDecodeSerializablePast ByteString
- | PHPSessionCouldntDecodeObjectPast ByteString
- | PHPSessionCouldntDecodeStringPast ByteString
- | PHPSessionCouldntDecodePast ByteString
- | PHPSessionValueNotFullyDecoded PHPSessionValue ByteString
- | PHPSessionNotFullyDecoded PHPSessionVariableList ByteString
PHP session types
type PHPSessionVariableList = [(ByteString, PHPSessionValue)]Source
Holds the "top-level" session variables and their value contents.
data PHPSessionClassName Source
Represents the name of a PHP class.
PHPSessionClassName ByteString |
data PHPSessionValue Source
PHPSessionValue
Represents a PHP value, which may be a number, string,
array, object, boolean, null, or references.
-
PHPSessionValueArray
represents an array as a list of key-value pairs of values of typePHPSessionValue
. -
PHPSessionValueObject
is similar toPHPSessionValueArray
but also includes a class name of typePHPSessionClassName
. -
PHPSessionValueObjectSerializeable
represent objects of which their classes implement Serializeable to handle their own serialization and don't use the normal serialization format for its contained objects. -
PHPSessionValueBool
,PHPSessionValueInt
,PHPSessionValueFloat
,PHPSessionValueNull
, andPHPSessionValueString
represent basic types boolean, integer, floats, null and string respectively. -
PHPSessionValueFloat
stores the number representation as anEither
Int
Double
to preserve instances where the number representation is actually an integer. It should be noted that the re-encoded value is usually rounded unlike PHP's representation. -
PHPSessionValueMisc
stores a few other types such as references and values which follow the general serialization format but aren't recognized by the decoder. A list ofPHPSessionAttr
provides the information for reconstructing the serialized representation when re-encoding this type of value.
PHPSessionValueArray [(PHPSessionValue, PHPSessionValue)] | |
PHPSessionValueBool Bool | |
PHPSessionValueFloat (Either Int Double) | |
PHPSessionValueInt Int | |
PHPSessionValueNull | |
PHPSessionValueObject PHPSessionClassName [(PHPSessionValue, PHPSessionValue)] | |
PHPSessionValueObjectSerializeable PHPSessionClassName ByteString | |
PHPSessionValueString ByteString | |
PHPSessionValueMisc ByteString [PHPSessionAttr] |
data PHPSessionAttr Source
PHPSessionAttr
are values associated with PHPSessionValueMisc
to inspect and
generally re-encode the necessary information for that value.
Eq PHPSessionAttr | |
Show PHPSessionAttr |
data PHPSessionDecodingError Source
PHPSessionDecodingError
are error types that can be returned if decoding
did not succeed. They are returned by the Either
versions of the decoding
functions.
-
PHPSessionStringEmpty
is given if the decoder got an empty byte sequence. -
PHPSessionCouldntDecodeSerializablePast
is given if the decoding does not succeed while in the particular byte sequence for a class that implements Serializable. -
PHPSessionCouldntDecodeObjectPast
is given if the decoding does not succeed while in the particular byte sequence for a PHP object value. -
PHPSessionCouldntDecodeStringPast
is given if the decoding does not succeed while in the particular byte sequence for a PHP string. -
PHPSessionCouldntDecodePast
is given if the decoding does not succeed while decoding common byte sequences which are composed mainly ofPHPSessionAttr
forms. -
PHPSessionValueNotFullyDecoded
is given if the byte sequence is not fully decoded to aPHPSessionValue
when using decodePHPSessionValue or decodePHPSessionValueEither. -
PHPSessionNotFullyDecoded
is given.if the byte sequence is not fully decoded to aPHPSessionVariableList
when using decodePHPSession or decodePHPSessionEither.
PHPSessionStringEmpty | |
PHPSessionCouldntDecodeSerializablePast ByteString | |
PHPSessionCouldntDecodeObjectPast ByteString | |
PHPSessionCouldntDecodeStringPast ByteString | |
PHPSessionCouldntDecodePast ByteString | |
PHPSessionValueNotFullyDecoded PHPSessionValue ByteString | |
PHPSessionNotFullyDecoded PHPSessionVariableList ByteString |