|
Previous Class |
Solar_Json |
Next Page |
Solar_Json
Class for wrapping JSON encoding/decoding functionality.
Given that the json extension to PHP will be enabled by default in PHP 5.2.0+, Solar_Json allows users to get a jump on JSON encoding and decoding early if the native json_* functions are not present.
Solar_Json::encode and Solar_Json::decode functions are designed to pass the same unit tests bundled with the native PHP json ext.
Based largely on the Services_JSON package by Michal Migurski, Matt Knapp and Brett Stimmerman. See the original code at http://mike.teczno.com/JSON/JSON.phps
Catalog
This class is part of the Solar_Json package.
Inheritance:
- Solar_Base
- Solar_Json
Constants
Public Properties
The Solar_Json class has no public properties; try the list of all properties.
Public Methods
These are all the public methods in the Solar_Json class.
You can also view the list of all public, protected, and private methods.
__construct()- Constructor.
__destruct()- Default destructor; does nothing other than provide a safe fallback for calls to parent::__destruct().
apiVersion()- Reports the API version for this class.
decode()- Decodes the $encodedValue string which is encoded in the JSON format.
dump()- Convenience method for getting a dump the whole object, or one of its properties, or an external variable.
encode()- Encodes the mixed $valueToEncode into JSON format.
locale()- Looks up class-specific locale strings based on a key.