6 class Client
implements \SplSubject
, \Countable
11 public $recordHistory;
13 public function __construct($driver = NULL, $persistent_handle_id = NULL) {
16 public function reset() {
19 public function enqueue(\http\Client\Request
$request, $callable = NULL) {
22 public function dequeue(\http\Client\Request
$request) {
25 public function requeue(\http\Client\Request
$request, $callable = NULL) {
28 public function count() {
31 public function send() {
34 public function once() {
37 public function wait($timeout = NULL) {
40 public function getResponse(\http\Client\Request
$request = NULL) {
43 public function getHistory() {
46 public function configure(array $settings) {
49 public function enablePipelining($enable = NULL) {
52 public function enableEvents($enable = NULL) {
55 public function notify(\http\Client\Request
$request = NULL) {
58 public function attach(\SplObserver
$observer) {
61 public function detach(\SplObserver
$observer) {
64 public function getObservers() {
67 public function getProgressInfo(\http\Client\Request
$request) {
70 public function getTransferInfo(\http\Client\Request
$request) {
73 public function setOptions(array $options = NULL) {
76 public function getOptions() {
79 public function setSslOptions(array $ssl_option = NULL) {
82 public function addSslOptions(array $ssl_options = NULL) {
85 public function getSslOptions() {
88 public function setCookies(array $cookies = NULL) {
91 public function addCookies(array $cookies = NULL) {
94 public function getCookies() {
97 public static function getAvailableDrivers() {
100 public function getAvailableOptions() {
103 public function getAvailableConfiguration() {
118 public function __construct($cookie_string = NULL, $parser_flags = NULL, $allowed_extras = NULL) {
121 public function getCookies() {
124 public function setCookies($cookies = NULL) {
127 public function addCookies($cookies) {
130 public function getCookie($name) {
133 public function setCookie($cookie_name, $cookie_value = NULL) {
136 public function addCookie($cookie_name, $cookie_value) {
139 public function getExtras() {
142 public function setExtras($extras = NULL) {
145 public function addExtras($extras) {
148 public function getExtra($name) {
151 public function setExtra($extra_name, $extra_value = NULL) {
154 public function addExtra($extra_name, $extra_value) {
157 public function getDomain() {
160 public function setDomain($value = NULL) {
163 public function getPath() {
166 public function setPath($value = NULL) {
169 public function getExpires() {
172 public function setExpires($value = NULL) {
175 public function getMaxAge() {
178 public function setMaxAge($value = NULL) {
181 public function getFlags() {
184 public function setFlags($value = NULL) {
187 public function toArray() {
190 public function toString() {
193 public function __toString() {
200 public static function getRequestHeader($header_name = NULL) {
203 public static function getRequestBody($body_class_name = NULL) {
206 public static function getResponseStatusForCode($code) {
209 public static function getResponseStatusForAllCodes() {
212 public static function getResponseHeader($header_name = NULL) {
215 public static function getResponseCode() {
218 public static function setResponseHeader($header_name, $header_value = NULL, $response_code = NULL, $replace_header = NULL) {
221 public static function setResponseCode($code) {
224 public static function negotiateLanguage($supported, &$result_array = NULL) {
227 public static function negotiateContentType($supported, &$result_array = NULL) {
230 public static function negotiateEncoding($supported, &$result_array = NULL) {
233 public static function negotiateCharset($supported, &$result_array = NULL) {
236 public static function negotiate($params, $supported, $primary_type_separator = NULL, &$result_array = NULL) {
241 class Header
implements \Serializable
243 const MATCH_LOOSE
= 0;
244 const MATCH_CASE
= 1;
245 const MATCH_WORD
= 16;
246 const MATCH_FULL
= 32;
247 const MATCH_STRICT
= 33;
252 public function __construct($name = NULL, $value = NULL) {
255 public function serialize() {
258 public function __toString() {
261 public function toString() {
264 public function unserialize($serialized) {
267 public function match($value, $flags = NULL) {
270 public function negotiate($supported, &$result = NULL) {
273 public function getParams($param_sep = NULL, $arg_sep = NULL, $val_sep = NULL, $flags = NULL) {
276 public static function parse($string, $header_class = NULL) {
281 class Message
implements \Countable
, \Serializable
, \Iterator
284 const TYPE_REQUEST
= 1;
285 const TYPE_RESPONSE
= 2;
289 protected $requestMethod;
290 protected $requestUrl;
291 protected $responseStatus;
292 protected $responseCode;
293 protected $httpVersion;
295 protected $parentMessage;
297 public function __construct($message = NULL, $greedy = NULL) {
300 public function getBody() {
303 public function setBody(\http\Message\Body
$body) {
306 public function addBody(\http\Message\Body
$body) {
309 public function getHeader($header, $into_class = NULL) {
312 public function setHeader($header, $value = NULL) {
315 public function addHeader($header, $value) {
318 public function getHeaders() {
321 public function setHeaders(array $headers) {
324 public function addHeaders(array $headers, $append = NULL) {
327 public function getType() {
330 public function setType($type) {
333 public function getInfo() {
336 public function setInfo($http_info) {
339 public function getResponseCode() {
342 public function setResponseCode($response_code, $strict = NULL) {
345 public function getResponseStatus() {
348 public function setResponseStatus($response_status) {
351 public function getRequestMethod() {
354 public function setRequestMethod($request_method) {
357 public function getRequestUrl() {
360 public function setRequestUrl($url) {
363 public function getHttpVersion() {
366 public function setHttpVersion($http_version) {
369 public function getParentMessage() {
372 public function toString($include_parent = NULL) {
375 public function toCallback($callback) {
378 public function toStream($stream) {
381 public function count() {
384 public function serialize() {
387 public function unserialize($serialized) {
390 public function rewind() {
393 public function valid() {
396 public function current() {
399 public function key() {
402 public function next() {
405 public function __toString() {
408 public function detach() {
411 public function prepend(\http\Message
$message, $top = NULL) {
414 public function reverse() {
417 public function isMultipart(&$boundary = NULL) {
420 public function splitMultipartBody() {
425 class Params
implements \ArrayAccess
427 const DEF_PARAM_SEP
= ',';
428 const DEF_ARG_SEP
= ';';
429 const DEF_VAL_SEP
= '=';
430 const COOKIE_PARAM_SEP
= '';
432 const PARSE_ESCAPED
= 1;
433 const PARSE_URLENCODED
= 4;
434 const PARSE_DIMENSION
= 8;
435 const PARSE_RFC5987
= 16;
436 const PARSE_RFC5988
= 32;
437 const PARSE_DEFAULT
= 17;
438 const PARSE_QUERY
= 12;
446 final public function __construct($params = NULL, $param_sep = NULL, $arg_sep = NULL, $val_sep = NULL, $flags = NULL) {
449 public function toArray() {
452 public function toString() {
455 public function __toString() {
458 public function offsetExists($name) {
461 public function offsetUnset($name) {
464 public function offsetSet($name, $value) {
467 public function offsetGet($name) {
472 class QueryString
implements \Serializable
, \ArrayAccess
, \IteratorAggregate
476 const TYPE_FLOAT
= 2;
477 const TYPE_STRING
= 6;
478 const TYPE_ARRAY
= 4;
479 const TYPE_OBJECT
= 5;
481 private static $instance;
484 final public function __construct($params = NULL) {
487 public function toArray() {
490 public function toString() {
493 public function __toString() {
496 public function get($name = NULL, $type = NULL, $defval = NULL, $delete = NULL) {
499 public function set($params) {
502 public function mod($params = NULL) {
505 public function getBool($name, $defval = NULL, $delete = NULL) {
508 public function getInt($name, $defval = NULL, $delete = NULL) {
511 public function getFloat($name, $defval = NULL, $delete = NULL) {
514 public function getString($name, $defval = NULL, $delete = NULL) {
517 public function getArray($name, $defval = NULL, $delete = NULL) {
520 public function getObject($name, $defval = NULL, $delete = NULL) {
523 public function getIterator() {
526 public static function getGlobalInstance() {
529 public function xlate($from_encoding, $to_encoding) {
532 public function serialize() {
535 public function unserialize($serialized) {
538 public function offsetGet($offset) {
541 public function offsetSet($offset, $value) {
544 public function offsetExists($offset) {
547 public function offsetUnset($offset) {
556 const JOIN_QUERY
= 2;
557 const STRIP_USER
= 4;
558 const STRIP_PASS
= 8;
559 const STRIP_AUTH
= 12;
560 const STRIP_PORT
= 32;
561 const STRIP_PATH
= 64;
562 const STRIP_QUERY
= 128;
563 const STRIP_FRAGMENT
= 256;
564 const STRIP_ALL
= 492;
565 const FROM_ENV
= 4096;
566 const SANITIZE_PATH
= 8192;
567 const PARSE_MBLOC
= 65536;
568 const PARSE_MBUTF8
= 131072;
569 const PARSE_TOIDN
= 1048576;
570 const PARSE_TOPCT
= 2097152;
581 public function __construct($old_url = NULL, $new_url = NULL, $flags = NULL) {
584 public function mod($more_url_parts, $flags = NULL) {
587 public function toString() {
590 public function __toString() {
593 public function toArray() {
599 namespace http\Client
602 class Request
extends \http\Message
implements \Iterator
, \Serializable
, \Countable
606 public function __construct($method = NULL, $url = NULL, array $headers = NULL, \http\Message\Body
$body = NULL) {
609 public function setContentType($content_type) {
612 public function getContentType() {
615 public function setQuery($query_data = NULL) {
618 public function getQuery() {
621 public function addQuery($query_data) {
624 public function setOptions(array $options = NULL) {
627 public function getOptions() {
630 public function setSslOptions(array $ssl_options = NULL) {
633 public function getSslOptions() {
636 public function addSslOptions(array $ssl_options = NULL) {
641 class Response
extends \http\Message
implements \Iterator
, \Serializable
, \Countable
643 protected $transferInfo;
645 public function getCookies($flags = NULL, $allowed_extras = NULL) {
648 public function getTransferInfo($element = NULL) {
654 namespace http\Client\Curl
656 const AUTH_ANY
= -17;
657 const AUTH_BASIC
= 1;
658 const AUTH_DIGEST
= 2;
659 const AUTH_DIGEST_IE
= 16;
660 const AUTH_GSSNEG
= 4;
662 const HTTP_VERSION_1_0
= 1;
663 const HTTP_VERSION_1_1
= 2;
664 const HTTP_VERSION_2_0
= 3;
665 const HTTP_VERSION_ANY
= 0;
666 const IPRESOLVE_ANY
= 0;
667 const IPRESOLVE_V4
= 1;
668 const IPRESOLVE_V6
= 2;
669 const POSTREDIR_301
= 1;
670 const POSTREDIR_302
= 2;
671 const POSTREDIR_303
= 4;
672 const POSTREDIR_ALL
= 7;
673 const PROXY_HTTP
= 0;
674 const PROXY_HTTP_1_0
= 1;
675 const PROXY_SOCKS4
= 4;
676 const PROXY_SOCKS4A
= 5;
677 const PROXY_SOCKS5
= 5;
678 const PROXY_SOCKS5_HOSTNAME
= 5;
679 const SSL_VERSION_ANY
= 0;
680 const SSL_VERSION_SSLv2
= 2;
681 const SSL_VERSION_SSLv3
= 3;
682 const SSL_VERSION_TLSv1
= 1;
683 const SSL_VERSION_TLSv1_0
= 4;
684 const SSL_VERSION_TLSv1_1
= 5;
685 const SSL_VERSION_TLSv1_2
= 6;
688 namespace http\Encoding
691 abstract class Stream
693 const FLUSH_NONE
= 0;
694 const FLUSH_SYNC
= 1048576;
695 const FLUSH_FULL
= 2097152;
697 public function __construct($flags = NULL) {
700 public function update($data) {
703 public function flush() {
706 public function done() {
709 public function finish() {
715 namespace http\Encoding\Stream
718 class Dechunk
extends \http\Encoding\Stream
720 public static function decode($data, &$decoded_len = NULL) {
725 class Deflate
extends \http\Encoding\Stream
727 const TYPE_GZIP
= 16;
733 const STRATEGY_DEF
= 0;
734 const STRATEGY_FILT
= 256;
735 const STRATEGY_HUFF
= 512;
736 const STRATEGY_RLE
= 768;
737 const STRATEGY_FIXED
= 1024;
739 public static function encode($data, $flags = NULL) {
744 class Inflate
extends \http\Encoding\Stream
746 public static function decode($data) {
755 class Request
extends \http\Message
implements \Iterator
, \Serializable
, \Countable
762 public function __construct() {
765 public function getForm($name = NULL, $type = NULL, $defval = NULL, $delete = NULL) {
768 public function getQuery($name = NULL, $type = NULL, $defval = NULL, $delete = NULL) {
771 public function getCookie($name = NULL, $type = NULL, $defval = NULL, $delete = NULL) {
774 public function getFiles() {
779 class Response
extends \http\Message
implements \Iterator
, \Serializable
, \Countable
781 const CONTENT_ENCODING_NONE
= 0;
782 const CONTENT_ENCODING_GZIP
= 1;
785 const CACHE_MISS
= 2;
789 protected $contentType;
790 protected $contentDisposition;
791 protected $contentEncoding;
792 protected $cacheControl;
794 protected $lastModified;
795 protected $throttleDelay;
796 protected $throttleChunk;
798 public function __construct() {
801 public function __invoke($ob_string, $ob_flags = NULL) {
804 public function setEnvRequest(\http\Message
$env_request) {
807 public function setCookie($cookie) {
810 public function setContentType($content_type) {
813 public function setContentDisposition(array $disposition_params) {
816 public function setContentEncoding($content_encoding) {
819 public function setCacheControl($cache_control) {
822 public function setLastModified($last_modified) {
825 public function isCachedByLastModified($header_name = NULL) {
828 public function setEtag($etag) {
831 public function isCachedByEtag($header_name = NULL) {
834 public function setThrottleRate($chunk_size, $delay = NULL) {
837 public function send($stream = NULL) {
843 namespace http\Exception
846 class BadConversionException
extends \DomainException
implements \http\Exception
850 class UnexpectedValueException
extends \UnexpectedValueException
implements \http\Exception
854 class BadUrlException
extends \DomainException
implements \http\Exception
858 class BadMethodCallException
extends \BadMethodCallException
implements \http\Exception
862 class RuntimeException
extends \RuntimeException
implements \http\Exception
866 class InvalidArgumentException
extends \InvalidArgumentException
implements \http\Exception
870 class BadMessageException
extends \DomainException
implements \http\Exception
874 class BadHeaderException
extends \DomainException
implements \http\Exception
878 class BadQueryStringException
extends \DomainException
implements \http\Exception
883 namespace http\Header
889 const STATE_FAILURE
= -1;
890 const STATE_START
= 0;
892 const STATE_VALUE
= 2;
893 const STATE_VALUE_EX
= 3;
894 const STATE_HEADER_DONE
= 4;
895 const STATE_DONE
= 5;
897 public function getState() {
900 public function parse($data, $flags, array &$headers) {
903 public function stream($stream, $flags, array &$headers) {
909 namespace http\Message
912 class Body
implements \Serializable
914 public function __construct($stream = NULL) {
917 public function __toString() {
920 public function toString() {
923 public function serialize() {
926 public function unserialize($serialized) {
929 public function toStream($stream, $offset = NULL, $maxlen = NULL) {
932 public function toCallback($callback, $offset = NULL, $maxlen = NULL) {
935 public function getResource() {
938 public function getBoundary() {
941 public function append($string) {
944 public function addForm(array $fields = NULL, array $files = NULL) {
947 public function addPart(\http\Message
$message) {
950 public function etag() {
953 public function stat($field = NULL) {
961 const DUMB_BODIES
= 2;
962 const EMPTY_REDIRECTS
= 4;
964 const STATE_FAILURE
= -1;
965 const STATE_START
= 0;
966 const STATE_HEADER
= 1;
967 const STATE_HEADER_DONE
= 2;
968 const STATE_BODY
= 3;
969 const STATE_BODY_DUMB
= 4;
970 const STATE_BODY_LENGTH
= 5;
971 const STATE_BODY_CHUNKED
= 6;
972 const STATE_BODY_DONE
= 7;
973 const STATE_UPDATE_CL
= 8;
974 const STATE_DONE
= 9;
976 public function getState() {
979 public function parse($data, $flags, &$message) {
982 public function stream($stream, $flags, &$message) {