Parsed: 114709

<?php
_deprecated_file( basename( __FILE__ ), '5.3.0', '', 'The PHP native JSON extension is now a requirement.' );

if ( ! class_exists( 'Services_JSON' ) ) :
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * Converts to and from JSON format.
 *
 * JSON (JavaScript Object Notation) is a lightweight data-interchange
 * format. It is easy for humans to read and write. It is easy for machines
 * to parse and generate. It is based on a subset of the JavaScript
 * Programming Language, Standard ECMA-262 3rd Edition - December 1999.
 * This feature can also be found in  Python. JSON is a text format that is
 * completely language independent but uses conventions that are familiar
 * to programmers of the C-family of languages, including C, C++, C#, Java,
 * JavaScript, Perl, TCL, and many others. These properties make JSON an
 * ideal data-interchange language.
 *
 * This package provides a simple encoder and decoder for JSON notation. It
 * is intended for use with client-side JavaScript applications that make
 * use of HTTPRequest to perform server communication functions - data can
 * be encoded into JSON notation for use in a client-side javaScript, or
 * decoded from incoming JavaScript requests. JSON format is native to
 * JavaScript, and can be directly eval()'ed with no further parsing
 * overhead
 *
 * All strings should be in ASCII or UTF-8 format!
 *
 * LICENSE: Redistribution and use in source and binary forms, with or
 * without modification, are permitted provided that the following
 * conditions are met: Redistributions of source code must retain the
 * above copyright notice, this list of conditions and the following
 * disclaimer. Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following disclaimer
 * in the documentation and/or other materials provided with the
 * distribution.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
 * NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
 * @category
 * @package     Services_JSON
 * @author      Michal Migurski <mike-json@teczno.com>
 * @author      Matt Knapp <mdknapp[at]gmail[dot]com>
 * @author      Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
 * @copyright   2005 Michal Migurski
 * @version     CVS: $Id: JSON.php 305040 2010-11-02 23:19:03Z alan_k $
 * @license     https://www.opensource.org/licenses/bsd-license.php
 * @link        https://pear.php.net/pepr/pepr-proposal-show.php?id=198
 */


/**
 * Marker constant for Services_JSON::decode(), used to flag stack state
 */
define('SERVICES_JSON_SLICE',   1);


/**
 * Marker constant for Services_JSON::decode(), used to flag stack state
 */
define('SERVICES_JSON_IN_STR',  2);


/**
 * Marker constant for Services_JSON::decode(), used to flag stack state
 */
define('SERVICES_JSON_IN_ARR',  3);


/**
 * Marker constant for Services_JSON::decode(), used to flag stack state
 */
define('SERVICES_JSON_IN_OBJ',  4);


/**
 * Marker constant for Services_JSON::decode(), used to flag stack state
 */
define('SERVICES_JSON_IN_CMT', 5);


/**
 * Behavior switch for Services_JSON::decode()
 */
define('SERVICES_JSON_LOOSE_TYPE', 16);


/**
 * Behavior switch for Services_JSON::decode()
 */
define('SERVICES_JSON_SUPPRESS_ERRORS', 32);


/**
 * Behavior switch for Services_JSON::decode()
 */
define('SERVICES_JSON_USE_TO_JSON', 64);

/* class Services_JSON */
/* function Services_JSON::__construct() – constructs a new JSON instance */
/* function Services_JSON::Services_JSON() – PHP4 constructor. */
/* function Services_JSON::utf162utf8() – convert a string from one UTF-16 char to one UTF-8 char */
/* function Services_JSON::utf82utf16() – convert a string from one UTF-8 char to one UTF-16 char */
/* function Services_JSON::encode() – encodes an arbitrary variable into JSON format (and sends JSON Header) */
/* function Services_JSON::encodeUnsafe() – encodes an arbitrary variable into JSON format without JSON Header – warning – may allow XSS!!!!) */
/* function Services_JSON::_encode() – PRIVATE CODE that does the work of encodes an arbitrary variable into JSON format */
/* function Services_JSON::name_value() – array-walking function for use in generating JSON-formatted name-value pairs */
/* function Services_JSON::reduce_string() – reduce a string by removing leading and trailing comments and whitespace */
/* function Services_JSON::decode() – decodes a JSON string into appropriate variable */
/* function Services_JSON::isError() – */
/* function Services_JSON::strlen8() – Calculates length of string in bytes */
/* function Services_JSON::substr8() – Returns part of a string, interpreting $start and $length as number of bytes. */

if (class_exists('PEAR_Error')) {

/* class Services_JSON_Error */
/* function Services_JSON_Error::__construct() – PHP5 constructor. */
/* function Services_JSON_Error::Services_JSON_Error() – PHP4 constructor. */

} else {

/* class Services_JSON_Error */
/* function Services_JSON_Error::__construct() – PHP5 constructor. */
/* function Services_JSON_Error::Services_JSON_Error() – PHP4 constructor. */

}

endif;