phpserialize

package
v1.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TOKEN_NULL              rune = 'N'
	TOKEN_BOOL              rune = 'b'
	TOKEN_INT               rune = 'i'
	TOKEN_FLOAT             rune = 'd'
	TOKEN_STRING            rune = 's'
	TOKEN_ARRAY             rune = 'a'
	TOKEN_OBJECT            rune = 'O'
	TOKEN_OBJECT_SERIALIZED rune = 'C'
	TOKEN_REFERENCE         rune = 'R'
	TOKEN_REFERENCE_OBJECT  rune = 'r'
	TOKEN_SPL_ARRAY         rune = 'x'
	TOKEN_SPL_ARRAY_MEMBERS rune = 'm'

	SEPARATOR_VALUE_TYPE rune = ':'
	SEPARATOR_VALUES     rune = ';'

	DELIMITER_STRING_LEFT  rune = '"'
	DELIMITER_STRING_RIGHT rune = '"'
	DELIMITER_OBJECT_LEFT  rune = '{'
	DELIMITER_OBJECT_RIGHT rune = '}'

	FORMATTER_FLOAT     byte = 'g'
	FORMATTER_PRECISION int  = 17
)
View Source
const UNSERIALIZABLE_OBJECT_MAX_LEN = 10 * 1024 * 1024 * 1024

Variables

This section is empty.

Functions

func Debug

func Debug(value bool)

func PhpValueBool

func PhpValueBool(p PhpValue) (res bool)

func PhpValueFloat64

func PhpValueFloat64(p PhpValue) (res float64)

func PhpValueInt

func PhpValueInt(p PhpValue) (res int)

func PhpValueInt64

func PhpValueInt64(p PhpValue) (res int64)

func PhpValueString

func PhpValueString(p PhpValue) (res string)

func PhpValueUInt

func PhpValueUInt(p PhpValue) (res uint)

func PhpValueUInt64

func PhpValueUInt64(p PhpValue) (res uint64)

func Serialize

func Serialize(v PhpValue) (string, error)

Types

type PhpArray

type PhpArray map[PhpValue]PhpValue

type PhpObject

type PhpObject struct {
	// contains filtered or unexported fields
}

func NewPhpObject

func NewPhpObject(className string) *PhpObject

func (*PhpObject) GetClassName

func (self *PhpObject) GetClassName() string

func (*PhpObject) GetMembers

func (self *PhpObject) GetMembers() PhpArray

func (*PhpObject) GetPrivate

func (self *PhpObject) GetPrivate(name string) (v PhpValue, ok bool)

func (*PhpObject) GetProtected

func (self *PhpObject) GetProtected(name string) (v PhpValue, ok bool)

func (*PhpObject) GetPublic

func (self *PhpObject) GetPublic(name string) (v PhpValue, ok bool)

func (*PhpObject) SetClassName

func (self *PhpObject) SetClassName(name string) *PhpObject

func (*PhpObject) SetMembers

func (self *PhpObject) SetMembers(members PhpArray) *PhpObject

func (*PhpObject) SetPrivate

func (self *PhpObject) SetPrivate(name string, value PhpValue) *PhpObject

func (*PhpObject) SetProtected

func (self *PhpObject) SetProtected(name string, value PhpValue) *PhpObject

func (*PhpObject) SetPublic

func (self *PhpObject) SetPublic(name string, value PhpValue) *PhpObject

type PhpObjectSerialized

type PhpObjectSerialized struct {
	// contains filtered or unexported fields
}

func NewPhpObjectSerialized

func NewPhpObjectSerialized(className string) *PhpObjectSerialized

func (*PhpObjectSerialized) GetClassName

func (self *PhpObjectSerialized) GetClassName() string

func (*PhpObjectSerialized) GetData

func (self *PhpObjectSerialized) GetData() string

func (*PhpObjectSerialized) GetValue

func (self *PhpObjectSerialized) GetValue() PhpValue

func (*PhpObjectSerialized) SetClassName

func (self *PhpObjectSerialized) SetClassName(name string) *PhpObjectSerialized

func (*PhpObjectSerialized) SetData

func (self *PhpObjectSerialized) SetData(data string) *PhpObjectSerialized

func (*PhpObjectSerialized) SetValue

func (self *PhpObjectSerialized) SetValue(value PhpValue) *PhpObjectSerialized

type PhpSlice

type PhpSlice []PhpValue

type PhpSplArray

type PhpSplArray struct {
	// contains filtered or unexported fields
}

func NewPhpSplArray

func NewPhpSplArray(array, properties PhpValue) *PhpSplArray

func (*PhpSplArray) GetArray

func (self *PhpSplArray) GetArray() PhpValue

func (*PhpSplArray) GetFlags

func (self *PhpSplArray) GetFlags() int

func (*PhpSplArray) GetProperties

func (self *PhpSplArray) GetProperties() PhpValue

func (*PhpSplArray) SetArray

func (self *PhpSplArray) SetArray(value PhpValue)

func (*PhpSplArray) SetFlags

func (self *PhpSplArray) SetFlags(value int)

func (*PhpSplArray) SetProperties

func (self *PhpSplArray) SetProperties(value PhpValue)

type PhpValue

type PhpValue interface{}

func UnSerialize

func UnSerialize(s string) (PhpValue, error)

type SerializedDecodeFunc

type SerializedDecodeFunc func(string) (PhpValue, error)

type SerializedEncodeFunc

type SerializedEncodeFunc func(PhpValue) (string, error)

type Serializer

type Serializer struct {
	// contains filtered or unexported fields
}

func NewSerializer

func NewSerializer() *Serializer

func (*Serializer) Encode

func (self *Serializer) Encode(v PhpValue) (string, error)

func (*Serializer) SetSerializedEncodeFunc

func (self *Serializer) SetSerializedEncodeFunc(f SerializedEncodeFunc)

type UnSerializer

type UnSerializer struct {
	// contains filtered or unexported fields
}

func NewUnSerializer

func NewUnSerializer(data string) *UnSerializer

func (*UnSerializer) Decode

func (self *UnSerializer) Decode() (PhpValue, error)

func (*UnSerializer) SetReader

func (self *UnSerializer) SetReader(r *strings.Reader)

func (*UnSerializer) SetSerializedDecodeFunc

func (self *UnSerializer) SetSerializedDecodeFunc(f SerializedDecodeFunc)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL