-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | PHP session and values serialization
--
@package hs-php-session
@version 0.0.9.2
-- | Types used for representing PHP data types from encoding and decoding
-- a PHP session.
module Data.PHPSession.Types
-- | Holds the "top-level" session variables and their value contents.
type PHPSessionVariableList = [(ByteString, PHPSessionValue)]
-- | Represents the name of a PHP class.
data PHPSessionClassName
PHPSessionClassName :: ByteString -> PHPSessionClassName
-- | PHPSessionValue Represents a PHP value, which may be a number,
-- string, array, object, boolean, null, or references.
--
--
data PHPSessionValue
PHPSessionValueArray :: [(PHPSessionValue, PHPSessionValue)] -> PHPSessionValue
PHPSessionValueBool :: Bool -> PHPSessionValue
PHPSessionValueFloat :: (Either Int Double) -> PHPSessionValue
PHPSessionValueInt :: Int -> PHPSessionValue
PHPSessionValueNull :: PHPSessionValue
PHPSessionValueObject :: PHPSessionClassName -> [(PHPSessionValue, PHPSessionValue)] -> PHPSessionValue
PHPSessionValueObjectSerializeable :: PHPSessionClassName -> ByteString -> PHPSessionValue
PHPSessionValueString :: ByteString -> PHPSessionValue
PHPSessionValueMisc :: ByteString -> [PHPSessionAttr] -> PHPSessionValue
-- | PHPSessionAttr are values associated with
-- PHPSessionValueMisc to inspect and generally re-encode the
-- necessary information for that value.
data PHPSessionAttr
PHPSessionAttrInt :: Int -> PHPSessionAttr
PHPSessionAttrFloat :: Double -> PHPSessionAttr
PHPSessionAttrNested :: [PHPSessionValue] -> PHPSessionAttr
-- | PHPSessionDecodingError are error types that can be returned if
-- decoding did not succeed. They are returned by the Either
-- versions of the decoding functions.
--
--
data PHPSessionDecodingError
PHPSessionStringEmpty :: PHPSessionDecodingError
PHPSessionCouldntDecodeSerializablePast :: ByteString -> PHPSessionDecodingError
PHPSessionCouldntDecodeObjectPast :: ByteString -> PHPSessionDecodingError
PHPSessionCouldntDecodeStringPast :: ByteString -> PHPSessionDecodingError
PHPSessionCouldntDecodePast :: ByteString -> PHPSessionDecodingError
PHPSessionValueNotFullyDecoded :: PHPSessionValue -> ByteString -> PHPSessionDecodingError
PHPSessionNotFullyDecoded :: PHPSessionVariableList -> ByteString -> PHPSessionDecodingError
instance Eq PHPSessionDecodingError
instance Show PHPSessionDecodingError
instance Eq PHPSessionAttr
instance Show PHPSessionAttr
instance Ord PHPSessionValue
instance Eq PHPSessionValue
instance Show PHPSessionValue
instance Eq PHPSessionClassName
instance Show PHPSessionClassName
-- | Encodes and decodes serialized PHP sessions in the format used by the
-- "php" setting for session.serialize_handler.
module Data.PHPSession
-- | Decodes a ByteString containing a serialization of a list of
-- session variables using the "php" session serialization format into a
-- PHPSessionVariableList
decodePHPSession :: ByteString -> Maybe PHPSessionVariableList
-- | A version of decodePHPSession that returns a
-- PHPSessionDecodingError when decoding the ByteString
-- fails.
decodePHPSessionEither :: ByteString -> Either PHPSessionDecodingError PHPSessionVariableList
-- | Decodes a ByteString containing a session serialization of a
-- value into a PHPSessionValue. The format being decoded is
-- similar if not probably the same format used by PHP's
-- serialize/unserialize functions. Nothing is returned if the
-- input bytestring could not be parsed correctly.
decodePHPSessionValue :: ByteString -> Maybe PHPSessionValue
-- | A version of decodePHPSessionValue that returns
-- PHPSessionDecodingError when decoding the ByteString
-- fails.
decodePHPSessionValueEither :: ByteString -> Either PHPSessionDecodingError PHPSessionValue
-- | Encode a PHPSessionVariableList into a ByteString
-- containing the serialization of a list of session variables using the
-- "php" session serialization format.
encodePHPSession :: PHPSessionVariableList -> ByteString
-- | Encode a PHPSessionValue into a ByteString containing
-- the serialization of a PHP value. The format being encoded into is
-- similar if not probably the same format used by PHP's
-- serialize/unserialize functions.
encodePHPSessionValue :: PHPSessionValue -> ByteString
-- | Decodes as much of a ByteString as needed into a
-- PHPSessionValue and returns the rest of the string. Decoding
-- ends at either the end of the string or when the extent of the current
-- nested structure is met when an extra closing curly brace is
-- encountered. The format being decoded is similar if not probably the
-- same format used by PHP's serialize/unserialize functions.
-- Nothing is returned if the input bytestring could not be parsed
-- correctly.
decodePartialPHPSessionValue :: ByteString -> Maybe (PHPSessionValue, ByteString)
-- | A version of decodePartialPHPSessionValue that uses Either, on
-- decoding error a PHPSessionDecodingError is returned.
decodePartialPHPSessionValueEither :: ByteString -> Either PHPSessionDecodingError (PHPSessionValue, ByteString)
-- | Holds the "top-level" session variables and their value contents.
type PHPSessionVariableList = [(ByteString, PHPSessionValue)]
-- | Represents the name of a PHP class.
data PHPSessionClassName
PHPSessionClassName :: ByteString -> PHPSessionClassName
-- | PHPSessionValue Represents a PHP value, which may be a number,
-- string, array, object, boolean, null, or references.
--
--
data PHPSessionValue
PHPSessionValueArray :: [(PHPSessionValue, PHPSessionValue)] -> PHPSessionValue
PHPSessionValueBool :: Bool -> PHPSessionValue
PHPSessionValueFloat :: (Either Int Double) -> PHPSessionValue
PHPSessionValueInt :: Int -> PHPSessionValue
PHPSessionValueNull :: PHPSessionValue
PHPSessionValueObject :: PHPSessionClassName -> [(PHPSessionValue, PHPSessionValue)] -> PHPSessionValue
PHPSessionValueObjectSerializeable :: PHPSessionClassName -> ByteString -> PHPSessionValue
PHPSessionValueString :: ByteString -> PHPSessionValue
PHPSessionValueMisc :: ByteString -> [PHPSessionAttr] -> PHPSessionValue
-- | PHPSessionAttr are values associated with
-- PHPSessionValueMisc to inspect and generally re-encode the
-- necessary information for that value.
data PHPSessionAttr
PHPSessionAttrInt :: Int -> PHPSessionAttr
PHPSessionAttrFloat :: Double -> PHPSessionAttr
PHPSessionAttrNested :: [PHPSessionValue] -> PHPSessionAttr