encode()
encodeClass()
encodeClasses()
encodeUnicodeString()
__construct()
_encodeArray()
_encodeDatum()
_encodeObject()
_encodeString()
_encodeValue()
_utf82utf16()
_wasVisited()
_encodeConstants()
_encodeMethods()
_encodeVariables()
$cycleCheck
$options
$visited
Encode PHP constructs to JSON
encode(mixed $value, bool $cycleCheck, array $options) : string
mixedThe value to be encoded
boolWhether or not to check for possible object recursion when encoding
arrayAdditional options used during encoding
stringThe encoded valueencodeClass(\Zend\Json\$className $className, \Zend\Json\$package $package) : string
NOTE: Currently only public methods and variables are proxied onto the client machine
\Zend\Json\$classNamestring The name of the class, the class must be instantiable using a null constructor
\Zend\Json\$packagestring Optional package name appended to JavaScript proxy class name
\Zend\Json\Exception\InvalidArgumentException |
|---|
stringThe class2 (JavaScript) encoding of the classencodeClasses(array $classNames, string $package) : string
Returns JSON encoded classes, using encodeClass().
array
string
stringencodeUnicodeString(string $value) : string
This algorithm was originally developed for the Solar Framework by Paul M. Jones
| link | http://solarphp.com/ |
|---|---|
| link | http://svn.solarphp.com/core/trunk/Solar/JSON.php |
string
string__construct(bool $cycleCheck, array $options) : \Zend\Json\Encoder
boolWhether or not to check for recursion when encoding
arrayAdditional options used during encoding
_encodeArray(\Zend\Json\$array $array) : string
Recursively encodes each value of an array and returns a JSON encoded array string.
Arrays are defined as integer-indexed arrays starting at index 0, where the last index is (count($array) -1); any deviation from that is considered an associative array, and will be encoded as such.
\Zend\Json\$arrayarray
string_encodeDatum(mixed $value) : string
If value type is not a string, number, boolean, or null, the string 'null' is returned.
mixed
string_encodeObject(\Zend\Json\$value $value) : string
A special property is added to the JSON object called '__className' that contains the name of the class of $value. This is used to decode the object on the client into a specific class.
\Zend\Json\$valueobject
\Zend\Json\Exception\RecursionException |
If recursive checks are enabled and the object has been serialized previously |
|---|
string_encodeString(string $string) : string
string
string_encodeValue(\Zend\Json\$value $value) : string
$values are either - objects (returns from _encodeObject()) - arrays (returns from _encodeArray()) - basic datums (e.g. numbers or strings) (returns from _encodeDatum())
\Zend\Json\$valuemixed The value to be encoded
stringEncoded value_utf82utf16(string $utf8) : string
Normally should be handled by mb_convert_encoding, but provides a slower PHP-only method for installations that lack the multibyte string extension.
This method is from the Solar Framework by Paul M. Jones
| link | http://solarphp.com |
|---|
stringUTF-8 character
stringUTF-16 character_wasVisited(mixed $value) : bool
mixed
bool_encodeConstants(\ReflectionClass $cls) : string
The encoding format is based on the class2 format
\ReflectionClass
stringEncoded constant block in class2 format_encodeMethods(\ReflectionClass $cls) : string
_encodeVariables(\ReflectionClass $cls) : string
$cycleCheck : bool
$visited : array