Пример #1
0
 /**
  * Encode a given value with PEAR::HTML_AJAX.
  *
  * @param mixed $value
  * @return string JSON string representation of a given value
  *                or false if error ocurrs.
  * @throws PIECE_UNITY_ERROR_INVOCATION_FAILED
  * @static
  */
 function encodeWithHTMLAJAX($value)
 {
     include_once 'PEAR.php';
     $encoder =& new HTML_AJAX_JSON();
     PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
     $json = $encoder->encode($value);
     PEAR::staticPopErrorHandling();
     if (HTML_AJAX_JSON::isError($json)) {
         Piece_Unity_Error::pushPEARError($json, PIECE_UNITY_ERROR_INVOCATION_FAILED, "Failed to invoke the plugin [ {$this->_name} ].");
         return;
     }
     return $json;
 }