-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | PHP session and values serialization -- -- A library for encoding and decoding serialized PHP sessions in the -- format used by the "php" setting for session.serialize_handler as well -- as encoding and decoding serialized values. @package hs-php-session @version 0.0.9.0 -- | 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 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 -- | 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 -- | 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) -- | 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