Read the value of a class constant.
This is the same as just typing self::CONSTANTNAME, but throws a more useful message if the constant is not defined and allows the constant to be limited to a maximum length.
|string||$key||Name of the constant.|
|int|null||$byte_limit||Maximum number of bytes permitted in the value.|
|string||Value of the constant.|
Is this future's process complete? Specifically, can this future be resolved without blocking?
|bool||If true, the external process is complete and resolving this future will not block.|
Resolve a future and return its result, blocking until the result is ready if necessary.
|float||$timeout||Optional timeout after which resolution will pause and execution will return to the caller.|
|mixed||Future result, or null if the timeout is hit.|
If an exception was set by setException(), throw it.
Retrieve a list of sockets which we can wait to become readable while a future is resolving. If your future has sockets which can be select()ed, return them here (or in getWriteSockets()) to make the resolve loop do a select(). If you do not return sockets in either case, you'll get a busy wait.
|list||A list of sockets which we expect to become readable.|
Retrieve a list of sockets which we can wait to become writable while a future is resolving. See getReadSockets().
|list||A list of sockets which we expect to become writable.|
Wait for activity on one of several sockets.
|list||$read_list||List of sockets expected to become readable.|
|list||$write_list||List of sockets expected to become writable.|
|float||$timeout||Timeout, in seconds.|
Retrieve the final result of the future. This method will be called after the future is ready (as per isReady()) but before results are passed back to the caller. The major use of this function is that you can override it in subclasses to do postprocessing or error checking, which is particularly useful if building application-specific futures on top of primitive transport futures (like CurlFuture and ExecFuture) which can make it tricky to hook this logic into the main pipeline.
|mixed||Final resolution of this future.|
Default amount of time to wait on stream select for this future. Normally 1 second is fine, but if the future has a timeout sooner than that it should return the amount of time left before the timeout.
|string||$uri||Fully-qualified URI to send a request to.|
|mixed||$data||String or array to include in the request. Strings will be transmitted raw; arrays will be encoded and sent as 'application/x-www-form-urlencoded'.|
Set a timeout for the service call. If the request hasn't resolved yet, the future will resolve with a status that indicates the request timed out. You can determine if a status is a timeout status by calling isTimeout() on the status object.
|float||$timeout||Maximum timeout, in seconds.|
Get the currently configured timeout.
|float||Maximum number of seconds the request will execute for.|
Select the HTTP method (e.g., "GET", "POST", "PUT") to use for the request. By default, requests use "GET".
|string||$method||HTTP method name.|
Get the HTTP method the request will use.
|string||HTTP method name, like "GET".|
Set the URI to send the request to. Note that this is also a constructor parameter.
|string||$uri||URI to send the request to.|
Get the fully-qualified URI the request will be made to.
|string||URI the request will be sent to.|
Provide data to send along with the request. Note that this is also a constructor parameter; it may be more convenient to provide it there. Data must be a string (in which case it will be sent raw) or an array (in which case it will be encoded and sent as 'application/x-www-form-urlencoded').
|mixed||$data||Data to send with the request.|
Get the data which will be sent with the request.
|mixed||Data which will be sent.|
Add an HTTP header to the request. The same header name can be specified more than once, which will cause multiple headers to be sent.
|string||$name||Header name, like "Accept-Language".|
|string||$value||Header value, like "en-us".|
Get headers which will be sent with the request. Optionally, you can provide a filter, which will return only headers with that name. For example:
$all_headers = $future->getHeaders(); $just_user_agent = $future->getHeaders('User-Agent');
In either case, an array with all (or all matching) headers is returned.
|string|null||$filter||Optional filter, which selects only headers with that name if provided.|
|array||List of all (or all matching) headers.|
Set the status codes that are expected in the response. If set, isError on the status object will return true for status codes that are not in the input array. Otherwise, isError will be true for any HTTP status code outside the 2xx range (notwithstanding other errors such as connection or transport issues).
|array|null||$status_codes||List of expected HTTP status codes.|
Return list of expected status codes, or null if not set.
|array|null||List of expected status codes.|
Add a HTTP basic authentication header to the request.
|string||$username||Username to authenticate with.|
|PhutilOpaqueEnvelope||$password||Password to authenticate with.|
Exception-oriented resolve(). Throws if the status indicates an error occurred.
|tuple||HTTP request result <body, headers> tuple.|
Parse a raw HTTP response into a <status, body, headers> tuple.
|string||$raw_response||Raw HTTP response.|
|tuple||Valid resolution tuple.|
Parse an HTTP header block.
|string||$head_raw||Raw HTTP headers.|
|list||List of HTTP header tuples.|
Find value of the first header with given name.
|list||$headers||List of headers from `resolve()`.|
|string||$search||Case insensitive header name.|
|string||Value of the header or null if not found.|
Build a result tuple indicating a parse error resulting from a malformed HTTP response.
|tuple||Valid resolution tuple.|
Create a temp file containing an SSL cert, and use it for this session.
This allows us to do host-specific SSL certificates in whatever client is using libphutil. e.g. in Arcanist, you could add an "ssl_cert" key to a specific host in ~/.arcrc and use that.
cURL needs this to be a file, it doesn't seem to be able to handle a string which contains the cert. So we make a temporary file and store it there.
|string||$certificate||The multi-line, possibly lengthy, SSL certificate to use.|
Set the SSL certificate to use for this session, given a path.
|string||$path||The path to a valid SSL certificate for this session|
Get the path to the SSL certificate for this session.
Set whether Location headers in the response will be respected. The default is true.
|boolean||$follow||true to follow any Location header present in the response, false to return the request directly|
Get whether Location headers in the response will be respected.
Set the fallback CA certificate if one is not specified for the session, given a path.
|string||$path||The path to a valid SSL certificate|
Set the fallback CA certificate if one is not specified for the session, given a string.
Get the fallback global CA certificate
Load contents of remote URI. Behaves pretty much like @file_get_contents($uri) but doesn't require allow_url_fopen.
Attach a file to the request.
|string||$key||HTTP parameter name.|
|string||$mime_type||File mime type.|
Callback invoked by cURL as it reads HTTP data from the response. We save the data to a buffer.
Read data from the response buffer.
|string||Response data, if available.|
Discard any buffered data. Normally, you call this after reading the data with read().
Produces a value safe to pass to CURLOPT_POSTFIELDS.
|wild||Some value, suitable for use in `CURLOPT_POSTFIELDS`.|
Detect strings which will cause cURL to do horrible, insecure things.
|string||$string||Possibly dangerous string.|
|bool||$is_query_string||True if this string is being used as part of a query string.|
Determine whether CURLOPT_CAINFO is usable on this system.
Write a raw HTTP body into the request.
You must write the entire body before starting the request.
Callback to pass data to cURL.