|
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
Package
This class is part of the Solar_Json package.
Inheritance:
- Solar_Base
- Solar_Json
Configuration Keys
bypass_ext: Flag to instruct Solar_Json to bypass native json extension, if installed.bypass_mb: Flag to instruct Solar_Json to bypass native mb_convert_encoding() function, if installed.noerror: Flag to instruct Solar_Json to return null for values it cannot encode rather than throwing an exceptions (PHP-only encoding) or PHP warnings (native json_encode() function).
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.
Local
- Overview
- Config
- Constants
- Properties
- Methods
- __construct()
- __destruct()
- _buildConfig()
- _deQuote()
- _exception()
- _json_decode()
- _json_encode()
- _name_value()
- _postConfig()
- _postConstruct()
- _preConfig()
- _reduce_string()
- _stripvalueslashes()
- _utf162utf8()
- _utf82utf16()
- apiVersion()
- decode()
- dump()
- encode()
- locale()