- rename HttpQueryString::getInstance() to HttpQueryString::singleton()
authorMichael Wallner <mike@php.net>
Tue, 7 Mar 2006 14:59:15 +0000 (14:59 +0000)
committerMichael Wallner <mike@php.net>
Tue, 7 Mar 2006 14:59:15 +0000 (14:59 +0000)
- rename HttpQueryString::iconv() to HttpQueryString::xlate()

docs/functions.html
http_querystring_object.c
package.xml
package2.xml
php_http_querystring_object.h
php_http_util_object.h
tests/HttpQueryString_001.phpt

index 148840804190bed8a03cf26a4e58d0f17ba34391..2f7668eba3f34fa59899367cc1ff42e8f450232d 100644 (file)
@@ -310,6 +310,7 @@ array where the following keys will be recognized:</p><pre> - redirect:
                      redirects to a different host<br />
  - proxyhost:        string, proxy host in "host[:port]" format<br />
  - proxyport:        int, use another proxy port as specified in proxyhost<br />
+ - proxytype:        int, HTTP_PROXY_HTTP, SOCKS4 or SOCKS5<br />
  - proxyauth:        string, proxy credentials in "user:pass" format<br />
  - proxyauthtype:    int, HTTP_AUTH_BASIC and/or HTTP_AUTH_NTLM<br />
  - httpauth:         string, http credentials in "user:pass" format<br />
@@ -329,6 +330,9 @@ array where the following keys will be recognized:</p><pre> - redirect:
  - cookiesession:    bool, accept (true) or reset (false) sessioncookies<br />
  - resume:           int, byte offset to start the download from;<br />
                      if the server supports ranges<br />
+ - range:            array, array of arrays, each containing two integers,<br />
+                     specifying the ranges to download if server support is<br />
+                     given; only recognized if the resume option is empty<br />
  - maxfilesize:      int, maximum file size that should be downloaded;<br />
                      has no effect, if the size of the requested entity is not known<br />
  - lastmodified:     int, timestamp for If-(Un)Modified-Since header<br />
@@ -562,6 +566,7 @@ HttpMessage::TYPE_REQUEST or supplied URL was empty.</p>
 <h3 id="HttpMessage_getParentMessage">HttpMessage HttpMessage::getParentMessage()</h3>
 <p>Get parent Message.</p>
 <p>Returns the parent HttpMessage on success, or NULL if there's none.</p>
+<p>Throws HttpMessageException.</p>
 <h3 id="HttpMessage_send">bool HttpMessage::send()</h3>
 <p>Send the Message according to its type as Response or Request.<br />
 This provides limited functionality compared to HttpRequest and HttpResponse.</p>
@@ -618,9 +623,9 @@ Operates on and modifies $_GET and $_SERVER['QUERY_STRING'] if global is TRUE.</
 "b" for bool, "i" for int, "f" for float, "s" for string, "a" for array and "o" for a stdClass object.</p>
 <h3 id="HttpQueryString_set">string HttpQueryString::set(mixed params)</h3>
 <p>Set query string entry/entries. NULL values will unset the variable.</p>
-<h3 id="HttpQueryString_getInstance">HttpQueryString HttpQueryString::getInstance([bool global = true])</h3>
+<h3 id="HttpQueryString_singleton">HttpQueryString HttpQueryString::singleton([bool global = true])</h3>
 <p>Get a single instance (differentiates between the global setting).</p>
-<h3 id="HttpQueryString_iconv">bool HttpQueryString::iconv(string ie, string oe)</h3>
+<h3 id="HttpQueryString_xlate">bool HttpQueryString::xlate(string ie, string oe)</h3>
 <p>Converts the query string from the source encoding ie to the target encoding oe.<br />
 WARNING: Don't use any character set that can contain NUL bytes like UTF-16.</p>
 <p>Returns TRUE on success or FALSE on failure.</p>
@@ -849,7 +854,7 @@ references the last received response.</p>
 references the last received response.  Use HttpMessage::getParentMessage()<br />
 to access the data of previously received responses within this request<br />
 cycle.</p>
-<p>Throws HttpException.</p>
+<p>Throws HttpException, HttpRuntimeException.</p>
 <h3 id="HttpRequest_getRequestMessage">HttpMessage HttpRequest::getRequestMessage()</h3>
 <p>Get sent HTTP message.</p>
 <p>Returns an HttpMessage object representing the sent request.</p>
@@ -1277,8 +1282,8 @@ http.cache_log is set.</p>
 <li><a href="#HttpQueryString_toArray">HttpQueryString::toArray()</a></li>
 <li><a href="#HttpQueryString_get">HttpQueryString::get()</a></li>
 <li><a href="#HttpQueryString_set">HttpQueryString::set()</a></li>
-<li><a href="#HttpQueryString_getInstance">HttpQueryString::getInstance()</a></li>
-<li><a href="#HttpQueryString_iconv">HttpQueryString::iconv()</a></li>
+<li><a href="#HttpQueryString_singleton">HttpQueryString::singleton()</a></li>
+<li><a href="#HttpQueryString_xlate">HttpQueryString::xlate()</a></li>
 <li><a href="#HttpQueryString_serialize">HttpQueryString::serialize()</a></li>
 <li><a href="#HttpQueryString_unserialize">HttpQueryString::unserialize()</a></li>
 </li>
@@ -1395,7 +1400,7 @@ http.cache_log is set.</p>
 </li>
 </ul>
 </div>
-    <p><b>Generated at: Fri, 24 Feb 2006 21:29:29 +0100</b></p>
+    <p><b>Generated at: Tue, 07 Mar 2006 15:57:21 +0100</b></p>
 </body>
 </html>
 
index 129e02caad08a18a32d4dd1d936dffe6502cf3eb..79f1b64a612d1b1069fe2d06b639a9d2b72831cf 100644 (file)
@@ -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;
index df1a694a77636297dc79518d53a6b5fae15e04c2..5b403d6f0a4dbc463c5d98d4ce29f3404a38a8da 100644 (file)
@@ -31,12 +31,15 @@ HttpResponse
   </maintainers>
  <release>
   <version>0.25.0</version>
-  <date>2006-03-06</date>
+  <date>2006-03-07</date>
   <license>BSD, revised</license>
   <state>beta</state>
   <notes>* 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 &apos;range&apos; request option.
 + Added &apos;proxytype&apos; request option.
index 0a7b5f6d82da843fbefb0f065a7e820ffb5cff3f..5edcb1779cd9a00aab9d2e18365bf98878d63a1e 100644 (file)
@@ -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
    <extension><name>spl</name></extension>
    <extension><name>session</name></extension>
    <extension><name>hash</name></extension>
+   <extension><name>iconv</name></extension>
   </optional>
  </dependencies>
  <providesextension>http</providesextension>
index b37f303b87e700179166eae54eaf34649a2c2b0f..0b77c3df482db54266829c7b834884c59e9cf074 100644 (file)
@@ -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);
index f9b8297c5349dd3e79af3885b3f329b185a8fd2b..07fe6f7d4837a3cd6bf5b9424ae5a3ab708acbeb 100644 (file)
@@ -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
 
index 162d49593af2c254fce577a22721c87f48e5d790..e1afcc039c1bcb6172b8d39d3c6f51ed844557d9 100644 (file)
@@ -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']);