flush
authorMichael Wallner <mike@php.net>
Tue, 5 Nov 2013 13:12:59 +0000 (14:12 +0100)
committerMichael Wallner <mike@php.net>
Tue, 5 Nov 2013 13:12:59 +0000 (14:12 +0100)
12 files changed:
http/Client/Request/__construct.md [new file with mode: 0644]
http/Client/Request/addQuery.md [new file with mode: 0644]
http/Client/Request/addSslOptions.md [new file with mode: 0644]
http/Client/Request/getContentType.md [new file with mode: 0644]
http/Client/Request/getOptions.md [new file with mode: 0644]
http/Client/Request/getQuery.md [new file with mode: 0644]
http/Client/Request/getSslOptions.md [new file with mode: 0644]
http/Client/Request/setContentType.md [new file with mode: 0644]
http/Client/Request/setOptions.md [new file with mode: 0644]
http/Client/Request/setQuery.md [new file with mode: 0644]
http/Client/Request/setSslOptions.md [new file with mode: 0644]
index.js

diff --git a/http/Client/Request/__construct.md b/http/Client/Request/__construct.md
new file mode 100644 (file)
index 0000000..e14a7ad
--- /dev/null
@@ -0,0 +1,24 @@
+# void http\Client\Request::__construct([string $meth = NULL[, string $url = NULL[, array $headers = NULL[, http\Message\Body $body = NULL]]]])
+
+Create a new client request message to be enqueued and sent by http\Client.
+
+## Params:
+
+* Optional string $meth = NULL  
+  The request method.
+* Optional string $url = NULL  
+  The request URL.
+* Optional array $headers = NULL  
+  HTTP headers.
+* Optional http\Message\Body $body = NULL  
+  Request body.
+
+## Throws:
+
+* http\Exception.
+
+## Example:
+
+    <?php
+    $request = new http\Client\Request("GET", "http://php.net/");
+    ?>
diff --git a/http/Client/Request/addQuery.md b/http/Client/Request/addQuery.md
new file mode 100644 (file)
index 0000000..5ecd5ab
--- /dev/null
@@ -0,0 +1,13 @@
+# http\Client\Request http\Client\Request::addQuery(mixed $query_data)
+
+Add querystring data.
+See http\Client\Request::setQuery() and http\Message::setRequestUrl().
+
+## Params:
+
+* mixed $query_data  
+  Additional querystring data.
+
+## Returns:
+
+* http\Client\Request, self.
diff --git a/http/Client/Request/addSslOptions.md b/http/Client/Request/addSslOptions.md
new file mode 100644 (file)
index 0000000..40b4bd3
--- /dev/null
@@ -0,0 +1,13 @@
+# http\Client\Request http\Client\Request::addSslOptions([array $ssl_options = NULL])
+
+Add specific SSL options.
+See http\Client\Request::setSslOptions(), http\Client\Request::setOptions() and http\Client\Curl::$ssl options.
+
+## Params:
+
+* Optional array $ssl_options = NULL  
+  Add this SSL options.
+
+## Returns:
+
+* http\Client\Request, self.
diff --git a/http/Client/Request/getContentType.md b/http/Client/Request/getContentType.md
new file mode 100644 (file)
index 0000000..86097e8
--- /dev/null
@@ -0,0 +1,27 @@
+# string http\Client\Request::getContentType()
+
+Extract the currently set "Content-Type" header.
+See http\Client\Request::setContentType().
+
+## Params:
+
+None.
+
+## Returns:
+
+* string, the currently set content type.
+* NULL, if no "Content-Type" header is set.
+
+## Example:
+
+    <?php
+    $multi = new http\Message\Body;
+    $multi->addPart(new http\Message("Content-type: text/plain\n\nHello part 1!"));
+    $multi->addPart(new http\Message("Content-type: text/plain\n\nHello part 2!"));
+    $request = new http\Client\Request("POST", "http://localhost/", [], $multi);
+    var_dump($request->getContentType());
+    ?>
+
+Yields:
+
+    string(49) "multipart/form-data; boundary="30718774.3fcf95cc""
diff --git a/http/Client/Request/getOptions.md b/http/Client/Request/getOptions.md
new file mode 100644 (file)
index 0000000..dcf2739
--- /dev/null
@@ -0,0 +1,12 @@
+# array http\Client\Request::getOptions()
+
+Get priorly set options.
+See http\Client\Request::setOptions().
+
+## Params:
+
+None.
+
+## Returns:
+
+* array, options.
diff --git a/http/Client/Request/getQuery.md b/http/Client/Request/getQuery.md
new file mode 100644 (file)
index 0000000..44f503b
--- /dev/null
@@ -0,0 +1,24 @@
+# string http\Client\Request::getQuery()
+
+Retrieve the currently set querystring.
+
+## Params:
+
+None.
+
+## Returns:
+
+* string, the currently set querystring.
+* NULL, if no querystring is set.
+
+## Example:
+
+    <?php
+    var_dump((new http\Client\Request)->getQuery());
+    var_dump((new http\Client\Request("GET", "http://localhost/?foo"))->getQuery());
+    ?>
+
+Yields:
+
+    NULL
+    string(3) "foo"
diff --git a/http/Client/Request/getSslOptions.md b/http/Client/Request/getSslOptions.md
new file mode 100644 (file)
index 0000000..41d3583
--- /dev/null
@@ -0,0 +1,12 @@
+# array http\Client\Request::getSslOptions()
+
+Retrive priorly set SSL options.
+See http\Client\Request::getOptions() and http\Client\Request::setSslOptions().
+
+## Params:
+
+None.
+
+## Returns:
+
+* array, SSL options.
diff --git a/http/Client/Request/setContentType.md b/http/Client/Request/setContentType.md
new file mode 100644 (file)
index 0000000..6422529
--- /dev/null
@@ -0,0 +1,17 @@
+# http\Client\Request http\Client\Request::setContentType(string $content_type)
+
+Set the MIME content type of the request message.
+
+## Params:
+
+* string $content_type  
+  The MIME type used as "Content-Type".
+
+## Returns:
+
+* http\Client\Request, self.
+
+
+## Errors:
+
+* HTTP_E_INVALID_PARAM, if $content_type does not follow the general "primary/secondary" notation.
diff --git a/http/Client/Request/setOptions.md b/http/Client/Request/setOptions.md
new file mode 100644 (file)
index 0000000..4742d44
--- /dev/null
@@ -0,0 +1,16 @@
+# http\Client\Request http\Client\Request::setOptions([array $options = NULL])
+
+Set client options.
+See http\Client::setOptions() and http\Client\Curl.
+
+> **Note:** Only options specified prior enqueueing a request are applied to the request.
+
+## Params:
+
+* Optional array $options = NULL  
+  The options to set.
+
+## Returns:
+
+* http\Client\Request, self.
+
diff --git a/http/Client/Request/setQuery.md b/http/Client/Request/setQuery.md
new file mode 100644 (file)
index 0000000..009acbd
--- /dev/null
@@ -0,0 +1,25 @@
+# http\Client\Request http\Client\Request::setQuery([mixed $query_data = NULL])
+
+(Re)set the querystring.
+See http\Client\Request::addQuery() and http\Message::setRequestUrl().
+
+## Params:
+
+* mixed $query_data, new querystring data.
+
+## Returns:
+
+* http\Client\Request, self.
+
+## Example:
+
+    <?php
+    $q = new http\QueryString("foo=bar&bar=foo");
+    $r = new http\Client\Request;
+    $r->setQuery($q);
+    var_dump($r->getRequestUrl());
+    ?>
+
+Yields:
+
+    string(33) "http://localhost/?foo=bar&bar=foo"
diff --git a/http/Client/Request/setSslOptions.md b/http/Client/Request/setSslOptions.md
new file mode 100644 (file)
index 0000000..dce1008
--- /dev/null
@@ -0,0 +1,13 @@
+# http\Client\Request http\Client\Request::setSslOptions([array $ssl_options = NULL])
+
+Specifically set SSL options.
+See http\Client\Request::setOptions() and http\Client\Curl::$ssl options.
+
+## Params:
+
+* Optional array $ssl_options = NULL  
+  Set SSL options to this array.
+
+## Returns:
+
+* http\Client\Request, self.
index 45b5bb87f507905a029b95416381fcac4bc3f1fd..a6c39342de32691896e6890b274c8735219e57b9 100644 (file)
--- a/index.js
+++ b/index.js
@@ -86,7 +86,7 @@ function type(s, nn) {
                        return "<a href=\"/" + s.replace(/::|\\/g, "/") + "\">";
                }
        }
-       if (-1 !== (j = s.indexOf("\\"))) {
+       if (-1 !== (j = s.indexOf("\\")) && s.substr(j+1,1) !== "n") {
                return "<a href=\"/" + s.replace(/\\/g, "/").replace(/::|$/, "#") + "\">";
        }