#include "zend_interfaces.h"
#ifdef HAVE_ICONV
-# include "ext/standard/url.h"
+# undef PHP_ATOM_INC
# include "ext/iconv/php_iconv.h"
+# include "ext/standard/url.h"
#endif
#include "php_http_api.h"
HTTP_END_ARGS;
#ifndef WONKY
-HTTP_BEGIN_ARGS(getInstance, 0)
+HTTP_BEGIN_ARGS(singleton, 0)
HTTP_ARG_VAL(global, 0)
HTTP_END_ARGS;
#endif
HTTP_END_ARGS;
#ifdef HAVE_ICONV
-HTTP_BEGIN_ARGS(iconv, 2)
+HTTP_BEGIN_ARGS(xlate, 2)
HTTP_ARG_VAL(from_encoding, 0)
HTTP_ARG_VAL(to_encoding, 0)
HTTP_END_ARGS;
HTTP_QUERYSTRING_ME(get, ZEND_ACC_PUBLIC)
HTTP_QUERYSTRING_ME(set, ZEND_ACC_PUBLIC)
-#ifndef WONKY
- HTTP_QUERYSTRING_ME(getInstance, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
-#endif
-
HTTP_QUERYSTRING_GME(getBool, ZEND_ACC_PUBLIC)
HTTP_QUERYSTRING_GME(getInt, ZEND_ACC_PUBLIC)
HTTP_QUERYSTRING_GME(getFloat, ZEND_ACC_PUBLIC)
HTTP_QUERYSTRING_GME(getArray, ZEND_ACC_PUBLIC)
HTTP_QUERYSTRING_GME(getObject, ZEND_ACC_PUBLIC)
+#ifndef WONKY
+ HTTP_QUERYSTRING_ME(singleton, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+#endif
#ifdef HAVE_ICONV
- HTTP_QUERYSTRING_ME(iconv, ZEND_ACC_PUBLIC)
+ HTTP_QUERYSTRING_ME(xlate, ZEND_ACC_PUBLIC)
#endif
/* Implements Serializable */
zval *params = NULL, *qarray = NULL, *qstring = NULL, **_GET, **_SERVER, **QUERY_STRING;
SET_EH_THROW_HTTP();
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bz", &global, ¶ms)) {
+ if (!sapi_module.treat_data) {
+ http_error(HE_ERROR, HTTP_E_QUERYSTRING, "The SAPI does not have a treat_data function registered");
+ } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bz", &global, ¶ms)) {
if (global) {
if ( (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &_SERVER)) &&
(Z_TYPE_PP(_SERVER) == IS_ARRAY) &&
/* }}} */
#ifndef WONKY
-/* {{{ proto HttpQueryString HttpQueryString::getInstance([bool global = true])
+/* {{{ proto static HttpQueryString HttpQueryString::singleton([bool global = true])
*
* Get a single instance (differentiates between the global setting).
*/
-PHP_METHOD(HttpQueryString, getInstance)
+PHP_METHOD(HttpQueryString, singleton)
{
zend_bool global = 1;
zval *instance = GET_STATIC_PROP(instance);
/* }}} */
#ifdef HAVE_ICONV
-/* {{{ proto bool HttpQueryString::iconv(string ie, string oe)
+/* {{{ proto bool HttpQueryString::xlate(string ie, string oe)
*
* Converts the query string from the source encoding ie to the target encoding oe.
* WARNING: Don't use any character set that can contain NUL bytes like UTF-16.
*
* Returns TRUE on success or FALSE on failure.
*/
-PHP_METHOD(HttpQueryString, iconv)
+PHP_METHOD(HttpQueryString, xlate)
{
char *ie, *oe, *er = NULL;
int ie_len, oe_len;