diff --git a/reference/curl/book.xml b/reference/curl/book.xml index c29987b44d0c..80f311501b85 100644 --- a/reference/curl/book.xml +++ b/reference/curl/book.xml @@ -29,6 +29,7 @@ &reference.curl.curlhandle; &reference.curl.curlmultihandle; &reference.curl.curlsharehandle; + &reference.curl.curlsharepersistenthandle; &reference.curl.curlfile; &reference.curl.curlstringfile; diff --git a/reference/curl/curlsharepersistenthandle.xml b/reference/curl/curlsharepersistenthandle.xml new file mode 100644 index 000000000000..e679a1ac5281 --- /dev/null +++ b/reference/curl/curlsharepersistenthandle.xml @@ -0,0 +1,79 @@ + + + + The CurlSharePersistentHandle class + CurlSharePersistentHandle + + + + +
+ &reftitle.intro; + + Represents a persistent cURL "share" handle. + +
+ + +
+ &reftitle.classsynopsis; + + + + + final + CurlSharePersistentHandle + + + &Properties; + + public + readonly + array + options + + + + +
+ + +
+ &reftitle.properties; + + + options + + The CURL_LOCK_DATA_* caches shared between requests using this handle. + + + +
+ + + +
+ + + +
+ diff --git a/reference/curl/functions/curl-share-init-persistent.xml b/reference/curl/functions/curl-share-init-persistent.xml new file mode 100644 index 000000000000..2fb30455c59d --- /dev/null +++ b/reference/curl/functions/curl-share-init-persistent.xml @@ -0,0 +1,154 @@ + + + + curl_share_init_persistent + Initialize a persistent cURL share handle. + + + + &reftitle.description; + + CurlSharePersistentHandlecurl_share_init_persistent + arrayshare_options + + + Initialize a persistent cURL share handle + with the given share options. Unlike curl_share_init, + handles created by this function will not be destroyed at the end of the + PHP request. If a persistent share handle with the same set of + share_options is found, it will be reused. + + + + + &reftitle.parameters; + + + + share_options + + + A non-empty array of CURL_LOCK_DATA_* constants. + + + + CURL_LOCK_DATA_COOKIE + is not allowed and, if specified, this function will throw a + ValueError. Sharing cookies between PHP + requests may lead to inadvertently mixing up sensitive cookies between users. + + + + + + + + + + &reftitle.returnvalues; + + Returns a CurlSharePersistentHandle. + + + + + &reftitle.errors; + + + + If share_options is empty, this function throws + a ValueError. + + + + + If share_options contains a value not matching + a CURL_LOCK_DATA_*, + this function throws a ValueError. + + + + + If share_options contains + CURL_LOCK_DATA_COOKIE, this function throws a + ValueError. + + + + + If share_options contains a non-integer value, + this function throws a TypeError. + + + + + + + &reftitle.examples; + + <function>curl_share_init_persistent</function> example + + This example will create a persistent cURL share handle and demonstrate + sharing connections between them. If this is executed in a long-lived + PHP SAPI, $sh will survive between SAPI requests. + + + + + + ]]> + + + + + + &reftitle.seealso; + + curl_setopt + curl_share_init + + + + + diff --git a/reference/curl/functions/curl-share-init.xml b/reference/curl/functions/curl-share-init.xml index 6427425a56af..c3e8884e330f 100644 --- a/reference/curl/functions/curl-share-init.xml +++ b/reference/curl/functions/curl-share-init.xml @@ -103,6 +103,7 @@ curl_close($ch2); curl_share_setopt curl_share_close + curl_share_init_persistent diff --git a/reference/curl/versions.xml b/reference/curl/versions.xml index f12b0a2b97e3..5442810bbc9f 100644 --- a/reference/curl/versions.xml +++ b/reference/curl/versions.xml @@ -3,7 +3,7 @@ - + @@ -32,6 +32,7 @@ + @@ -53,6 +54,7 @@ +