Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
JSON -> Json
Browse files Browse the repository at this point in the history
- Renamed all directories and filenames from JSON to Json
- renamed all namespaces and classnames from JSON to Json
- Renamed methods and options that contained the verbiage "JSON" to contain the
  verbiage "Json"
  • Loading branch information
weierophinney committed Jul 20, 2010
2 parents 643e2df + a49e8f2 commit d59be1f
Show file tree
Hide file tree
Showing 24 changed files with 7,630 additions and 0 deletions.
571 changes: 571 additions & 0 deletions src/Decoder.php

Large diffs are not rendered by default.

580 changes: 580 additions & 0 deletions src/Encoder.php

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions src/Exception.php
@@ -0,0 +1,36 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Json
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
* @namespace
*/
namespace Zend\Json;

/**
* @uses \Zend\Exception
* @category Zend
* @package Zend_Json
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Exception extends \Zend\Exception
{}

85 changes: 85 additions & 0 deletions src/Expr.php
@@ -0,0 +1,85 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Json
* @subpackage Expr
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/

/**
* @namespace
*/
namespace Zend\Json;

/**
* Class for Zend_Json encode method.
*
* This class simply holds a string with a native Javascript Expression,
* so objects | arrays to be encoded with Zend_Json can contain native
* Javascript Expressions.
*
* Example:
* <code>
* $foo = array(
* 'integer' =>9,
* 'string' =>'test string',
* 'function' => Zend_Json_Expr(
* 'function(){ window.alert("javascript function encoded by Zend_Json") }'
* ),
* );
*
* Zend_Json::encode($foo, false, array('enableJsonExprFinder' => true));
* // it will returns json encoded string:
* // {"integer":9,"string":"test string","function":function(){window.alert("javascript function encoded by Zend_Json")}}
* </code>
*
* @category Zend
* @package Zend_Json
* @subpackage Expr
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Expr
{
/**
* Storage for javascript expression.
*
* @var string
*/
protected $_expression;

/**
* Constructor
*
* @param string $expression the expression to hold.
* @return void
*/
public function __construct($expression)
{
$this->_expression = (string) $expression;
}

/**
* Cast to string
*
* @return string holded javascript expression.
*/
public function __toString()
{
return $this->_expression;
}
}

0 comments on commit d59be1f

Please sign in to comment.