Encode PHP constructs to JSON
Constructor
Parameters: |
|
---|---|
Return type: | Encoder |
Use the JSON encoding scheme for the value specified
Parameters: |
|
---|---|
Return type: | string The encoded value |
Recursive driver which determines the type of value to be encoded and then dispatches to the appropriate method. $values are either
Parameters: | $value – The value to be encoded |
---|---|
Return type: | string Encoded value |
Encode an object to JSON by encoding each of the public properties
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.
Parameters: | $value – |
---|---|
Return type: | string |
Throws : | RecursionException If recursive checks are enabled and the object has been serialized previously |
Determine if an object has been serialized already
Parameters: | mixed – |
---|---|
Return type: | bool |
JSON encode an array value
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.
Parameters: | $array – |
---|---|
Return type: | string |
JSON encode a basic data type (string, number, boolean, null)
If value type is not a string, number, boolean, or null, the string ‘null’ is returned.
Parameters: | mixed – |
---|---|
Return type: | string |
JSON encode a string value by escaping characters as necessary
Parameters: | string – |
---|---|
Return type: | string |
Encode the constants associated with the ReflectionClass parameter. The encoding format is based on the class2 format
Parameters: | ReflectionClass – |
---|---|
Return type: | string Encoded constant block in class2 format |
Encode the public methods of the ReflectionClass in the class2 format
Parameters: | ReflectionClass – |
---|---|
Return type: | string Encoded method fragment |
Encode the public properties of the ReflectionClass in the class2 format.
Parameters: | ReflectionClass – |
---|---|
Return type: | string Encode properties list |
Encodes the given $className into the class2 model of encoding PHP classes into JavaScript class2 classes. NOTE: Currently only public methods and variables are proxied onto the client machine
Parameters: | $className – The name of the class, the class must be |
---|
param $package: | Optional package name appended to JavaScript |
---|
proxy class name
rtype: string The class2 (JavaScript) encoding of the class throws: InvalidArgumentException
Encode Unicode Characters to u0000 ASCII syntax.
This algorithm was originally developed for the Solar Framework by Paul M. Jones
Parameters: | string – |
---|---|
Return type: | string |
Convert a string from one UTF-8 char to one UTF-16 char.
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
Parameters: | string – UTF-8 character |
---|---|
Return type: | string UTF-16 character |