From: Michael Wallner Date: Tue, 7 Mar 2006 14:59:15 +0000 (+0000) Subject: - rename HttpQueryString::getInstance() to HttpQueryString::singleton() X-Git-Tag: RELEASE_1_0_0RC1~11 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=2d31adababe7af92c0153f8eff813c582c3d566c;p=m6w6%2Fext-http - rename HttpQueryString::getInstance() to HttpQueryString::singleton() - rename HttpQueryString::iconv() to HttpQueryString::xlate() --- diff --git a/docs/functions.html b/docs/functions.html index 1488408..2f7668e 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -310,6 +310,7 @@ array where the following keys will be recognized:

 - redirect:
                      redirects to a different host
- proxyhost: string, proxy host in "host[:port]" format
- proxyport: int, use another proxy port as specified in proxyhost
+ - proxytype: int, HTTP_PROXY_HTTP, SOCKS4 or SOCKS5
- proxyauth: string, proxy credentials in "user:pass" format
- proxyauthtype: int, HTTP_AUTH_BASIC and/or HTTP_AUTH_NTLM
- httpauth: string, http credentials in "user:pass" format
@@ -329,6 +330,9 @@ array where the following keys will be recognized:

 - redirect:
  - cookiesession:    bool, accept (true) or reset (false) sessioncookies
- resume: int, byte offset to start the download from;
if the server supports ranges
+ - range: array, array of arrays, each containing two integers,
+ specifying the ranges to download if server support is
+ given; only recognized if the resume option is empty
- maxfilesize: int, maximum file size that should be downloaded;
has no effect, if the size of the requested entity is not known
- lastmodified: int, timestamp for If-(Un)Modified-Since header
@@ -562,6 +566,7 @@ HttpMessage::TYPE_REQUEST or supplied URL was empty.

HttpMessage HttpMessage::getParentMessage()

Get parent Message.

Returns the parent HttpMessage on success, or NULL if there's none.

+

Throws HttpMessageException.

bool HttpMessage::send()

Send the Message according to its type as Response or Request.
This provides limited functionality compared to HttpRequest and HttpResponse.

@@ -618,9 +623,9 @@ Operates on and modifies $_GET and $_SERVER['QUERY_STRING'] if global is TRUE.

string HttpQueryString::set(mixed params)

Set query string entry/entries. NULL values will unset the variable.

-

HttpQueryString HttpQueryString::getInstance([bool global = true])

+

HttpQueryString HttpQueryString::singleton([bool global = true])

Get a single instance (differentiates between the global setting).

-

bool HttpQueryString::iconv(string ie, string oe)

+

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.

@@ -849,7 +854,7 @@ references the last received response.

references the last received response. Use HttpMessage::getParentMessage()
to access the data of previously received responses within this request
cycle.

-

Throws HttpException.

+

Throws HttpException, HttpRuntimeException.

HttpMessage HttpRequest::getRequestMessage()

Get sent HTTP message.

Returns an HttpMessage object representing the sent request.

@@ -1277,8 +1282,8 @@ http.cache_log is set.

  • HttpQueryString::toArray()
  • HttpQueryString::get()
  • HttpQueryString::set()
  • -
  • HttpQueryString::getInstance()
  • -
  • HttpQueryString::iconv()
  • +
  • HttpQueryString::singleton()
  • +
  • HttpQueryString::xlate()
  • HttpQueryString::serialize()
  • HttpQueryString::unserialize()
  • @@ -1395,7 +1400,7 @@ http.cache_log is set.

    -

    Generated at: Fri, 24 Feb 2006 21:29:29 +0100

    +

    Generated at: Tue, 07 Mar 2006 15:57:21 +0100

    diff --git a/http_querystring_object.c b/http_querystring_object.c index 129e02c..79f1b64 100644 --- a/http_querystring_object.c +++ b/http_querystring_object.c @@ -41,7 +41,7 @@ HTTP_BEGIN_ARGS(__construct, 0) HTTP_END_ARGS; #ifndef WONKY -HTTP_BEGIN_ARGS(getInstance, 0) +HTTP_BEGIN_ARGS(singleton, 0) HTTP_ARG_VAL(global, 0) HTTP_END_ARGS; #endif @@ -67,7 +67,7 @@ HTTP_BEGIN_ARGS(__getter, 1) 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; @@ -90,10 +90,6 @@ zend_function_entry http_querystring_object_fe[] = { 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) @@ -101,8 +97,11 @@ zend_function_entry http_querystring_object_fe[] = { 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 */ @@ -476,11 +475,11 @@ PHP_METHOD(HttpQueryString, set) /* }}} */ #ifndef WONKY -/* {{{ proto HttpQueryString HttpQueryString::getInstance([bool global = true]) +/* {{{ proto 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); @@ -535,14 +534,14 @@ HTTP_QUERYSTRING_GETTER(getObject, IS_OBJECT); /* }}} */ #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; diff --git a/package.xml b/package.xml index df1a694..5b403d6 100644 --- a/package.xml +++ b/package.xml @@ -31,12 +31,15 @@ HttpResponse 0.25.0 - 2006-03-06 + 2006-03-07 BSD, revised beta * Fixed bug #6924 (Linking fails on Mac OSX). * Fixed HttpRequest::addRawPostData(). +- Renamed HttpQueryString::getInstance() to more commonly used ::singleton(). +- Renamed HttpQueryString::iconv() to more generic ::xlate(). + + Added feature request http_put_data() and HttpRequest::(set|get|add)PutData(). + Added 'range' request option. + Added 'proxytype' request option. diff --git a/package2.xml b/package2.xml index 0a7b5f6..5edcb17 100644 --- a/package2.xml +++ b/package2.xml @@ -49,6 +49,9 @@ HttpResponse * Fixed bug #6924 (Linking fails on Mac OSX). * Fixed HttpRequest::addRawPostData(). +- Renamed HttpQueryString::getInstance() to more commonly used ::singleton(). +- Renamed HttpQueryString::iconv() to more generic ::xlate(). + + Added feature request http_put_data() and HttpRequest::(set|get|add)PutData(). + Added 'range' request option. + Added 'proxytype' request option. @@ -283,6 +286,7 @@ HttpResponse spl session hash + iconv http diff --git a/php_http_querystring_object.h b/php_http_querystring_object.h index b37f303..0b77c3d 100644 --- a/php_http_querystring_object.h +++ b/php_http_querystring_object.h @@ -44,9 +44,6 @@ PHP_METHOD(HttpQueryString, toString); PHP_METHOD(HttpQueryString, toArray); PHP_METHOD(HttpQueryString, get); PHP_METHOD(HttpQueryString, set); -#ifndef WONKY -PHP_METHOD(HttpQueryString, getInstance); -#endif PHP_METHOD(HttpQueryString, getBool); PHP_METHOD(HttpQueryString, getInt); PHP_METHOD(HttpQueryString, getFloat); @@ -54,7 +51,10 @@ PHP_METHOD(HttpQueryString, getString); PHP_METHOD(HttpQueryString, getArray); PHP_METHOD(HttpQueryString, getObject); #ifdef HAVE_ICONV -PHP_METHOD(HttpQueryString, iconv); +PHP_METHOD(HttpQueryString, xlate); +#endif +#ifndef WONKY +PHP_METHOD(HttpQueryString, singleton); #endif PHP_METHOD(HttpQueryString, serialize); PHP_METHOD(HttpQueryString, unserialize); diff --git a/php_http_util_object.h b/php_http_util_object.h index f9b8297..07fe6f7 100644 --- a/php_http_util_object.h +++ b/php_http_util_object.h @@ -21,22 +21,6 @@ extern zend_function_entry http_util_object_fe[]; extern PHP_MINIT_FUNCTION(http_util_object); -PHP_METHOD(HttpUtil, date); -PHP_METHOD(HttpUtil, buildUrl); -PHP_METHOD(HttpUtil, buildStr); -PHP_METHOD(HttpUtil, negotiateLanguage); -PHP_METHOD(HttpUtil, negotiateCharset); -PHP_METHOD(HttpUtil, negotiateContentType); -PHP_METHOD(HttpUtil, matchModified); -PHP_METHOD(HttpUtil, matchEtag); -PHP_METHOD(HttpUtil, parseHeaders); -PHP_METHOD(HttpUtil, parseMessage); -PHP_METHOD(HttpUtil, parseCookie); -PHP_METHOD(HttpUtil, chunkedDecode); -PHP_METHOD(HttpUtil, deflate); -PHP_METHOD(HttpUtil, inflate); -PHP_METHOD(HttpUtil, support); - #endif #endif diff --git a/tests/HttpQueryString_001.phpt b/tests/HttpQueryString_001.phpt index 162d495..e1afcc0 100644 --- a/tests/HttpQueryString_001.phpt +++ b/tests/HttpQueryString_001.phpt @@ -12,25 +12,25 @@ echo "-TEST\n"; $_GET = array('a'=>'b','c'=>'3.4','r'=>array(1,2,3)); $_SERVER['QUERY_STRING'] = 'a=b&c=3.4&r[0]=1&r[1]=2&r[2]=3'; -var_dump(HttpQueryString::getInstance()->get()); -var_dump(HttpQueryString::getInstance()->get('n')); -var_dump(HttpQueryString::getInstance()->get('a')); -var_dump(HttpQueryString::getInstance()->get('a', "i", 0, true)); -var_dump(HttpQueryString::getInstance()->get('a', "string", 'hi!')); -var_dump(HttpQueryString::getInstance()->get('c')); -var_dump(HttpQueryString::getInstance()->get('c', HttpQueryString::TYPE_INT)); -var_dump(HttpQueryString::getInstance()->get('c', HttpQueryString::TYPE_FLOAT)); -var_dump(HttpQueryString::getInstance()->get('c', HttpQueryString::TYPE_BOOL)); -var_dump(HttpQueryString::getInstance()->get('r')); -var_dump(HttpQueryString::getInstance()->get('r', HttpQueryString::TYPE_ARRAY)); -var_dump(HttpQueryString::getInstance()->get('r', HttpQueryString::TYPE_OBJECT)); +var_dump(HttpQueryString::singleton()->get()); +var_dump(HttpQueryString::singleton()->get('n')); +var_dump(HttpQueryString::singleton()->get('a')); +var_dump(HttpQueryString::singleton()->get('a', "i", 0, true)); +var_dump(HttpQueryString::singleton()->get('a', "string", 'hi!')); +var_dump(HttpQueryString::singleton()->get('c')); +var_dump(HttpQueryString::singleton()->get('c', HttpQueryString::TYPE_INT)); +var_dump(HttpQueryString::singleton()->get('c', HttpQueryString::TYPE_FLOAT)); +var_dump(HttpQueryString::singleton()->get('c', HttpQueryString::TYPE_BOOL)); +var_dump(HttpQueryString::singleton()->get('r')); +var_dump(HttpQueryString::singleton()->get('r', HttpQueryString::TYPE_ARRAY)); +var_dump(HttpQueryString::singleton()->get('r', HttpQueryString::TYPE_OBJECT)); -HttpQueryString::getInstance()->set(new HttpQueryString(false, 'z[0]=2')); +HttpQueryString::singleton()->set(new HttpQueryString(false, 'z[0]=2')); -HttpQueryString::getInstance()->set(array('a'=>'b', 'c'=> "3.4")); -HttpQueryString::getInstance()->set(array('a' => NULL)); +HttpQueryString::singleton()->set(array('a'=>'b', 'c'=> "3.4")); +HttpQueryString::singleton()->set(array('a' => NULL)); -var_dump(HttpQueryString::getInstance()); +var_dump(HttpQueryString::singleton()); var_dump($_GET); var_dump($_SERVER['QUERY_STRING']);