Page MenuHomeIsabelle/Phabricator

final class AphrontRequest
Phabricator Technical Documentation (Aphront)

This class is not documented.

Tasks

Accessing Request Data

Managing Cookies

  • private function getCookieDomainURI() — Get the domain which cookies should be set on for this request, or null if the request does not correspond to a valid cookie domain.
  • public function canSetCookies() — Determine if security policy rules will allow cookies to be set when responding to the request.
  • public function setCookie($name, $value) — Set a cookie which does not expire for a long time.
  • public function setTemporaryCookie($name, $value) — Set a cookie which expires soon.
  • private function setCookieWithExpiration($name, $value, $expire) — Set a cookie with a given expiration policy.

Working With a Phabricator Cluster

No methods for this task.

Other Methods

Methods

public function __construct($host, $path)

This method is not documented.
Parameters
$host
$path
Return
this//Implicit.//

public function setURIMap($uri_data)

This method is not documented.
Parameters
array$uri_data
Return
wild

public function getURIMap()

This method is not documented.
Return
wild

public function getURIData($key, $default)

This method is not documented.
Parameters
$key
$default
Return
wild

public function getURILineRange($key, $limit)

Read line range parameter data from the request.

Applications like Paste, Diffusion, and Harbormaster use "$12-14" in the URI to allow users to link to particular lines.

Parameters
string$keyURI data key to pull line range information from.
int|null$limitMaximum length of the range.
Return
null|pair<int, int>Null, or beginning and end of the range.

public static function parseURILineRange($range, $limit)

This method is not documented.
Parameters
$range
$limit
Return
wild

public function setApplicationConfiguration($application_configuration)

This method is not documented.
Parameters
$application_configuration
Return
wild

public function getApplicationConfiguration()

This method is not documented.
Return
wild

public function setPath($path)

This method is not documented.
Parameters
$path
Return
wild

public function getPath()

This method is not documented.
Return
wild

public function getHost()

This method is not documented.
Return
wild

public function setSite($site)

This method is not documented.
Parameters
AphrontSite$site
Return
wild

public function getSite()

This method is not documented.
Return
wild

public function setController($controller)

This method is not documented.
Parameters
AphrontController$controller
Return
wild

public function getController()

This method is not documented.
Return
wild

public function setRequestData($request_data)

This method is not documented.
Parameters
array$request_data
Return
wild

public function getRequestData()

This method is not documented.
Return
wild

public function getInt($name, $default)

This method is not documented.
Parameters
$name
$default
Return
wild

public function getBool($name, $default)

This method is not documented.
Parameters
$name
$default
Return
wild

public function getStr($name, $default)

This method is not documented.
Parameters
$name
$default
Return
wild

public function getArr($name, $default)

This method is not documented.
Parameters
$name
$default
Return
wild

public function getStrList($name, $default)

This method is not documented.
Parameters
$name
$default
Return
wild

public function getExists($name)

This method is not documented.
Parameters
$name
Return
wild

public function getFileExists($name)

This method is not documented.
Parameters
$name
Return
wild

public function isHTTPGet()

This method is not documented.
Return
wild

public function isHTTPPost()

This method is not documented.
Return
wild

public function isAjax()

This method is not documented.
Return
wild

public function isWorkflow()

This method is not documented.
Return
wild

public function isQuicksand()

This method is not documented.
Return
wild

public function isConduit()

This method is not documented.
Return
wild

public static function getCSRFTokenName()

This method is not documented.
Return
wild

public static function getCSRFHeaderName()

This method is not documented.
Return
wild

public static function getViaHeaderName()

This method is not documented.
Return
wild

public function validateCSRF()

This method is not documented.
Return
wild

public function isFormPost()

This method is not documented.
Return
wild

public function hasCSRF()

This method is not documented.
Return
wild

public function isFormOrHisecPost()

This method is not documented.
Return
wild

public function setCookiePrefix($prefix)

This method is not documented.
Parameters
$prefix
Return
wild

private function getPrefixedCookieName($name)

This method is not documented.
Parameters
$name
Return
wild

public function getCookie($name, $default)

This method is not documented.
Parameters
$name
$default
Return
wild

public function clearCookie($name)

This method is not documented.
Parameters
$name
Return
wild

private function getCookieDomainURI()

Get the domain which cookies should be set on for this request, or null if the request does not correspond to a valid cookie domain.

Return
PhutilURI|nullDomain URI, or null if no valid domain exists.

public function canSetCookies()

Determine if security policy rules will allow cookies to be set when responding to the request.

Return
boolTrue if setCookie() will succeed. If this method returns false, setCookie() will throw.

public function setCookie($name, $value)

Set a cookie which does not expire for a long time.

To set a temporary cookie, see setTemporaryCookie().

Parameters
string$nameCookie name.
string$valueCookie value.
Return
this

public function setTemporaryCookie($name, $value)

Set a cookie which expires soon.

To set a durable cookie, see setCookie().

Parameters
string$nameCookie name.
string$valueCookie value.
Return
this

private function setCookieWithExpiration($name, $value, $expire)

Set a cookie with a given expiration policy.

Parameters
string$nameCookie name.
string$valueCookie value.
int$expireEpoch timestamp for cookie expiration.
Return
this

public function setUser($user)

This method is not documented.
Parameters
$user
Return
wild

public function getUser()

This method is not documented.
Return
wild

public function getViewer()

This method is not documented.
Return
wild

public function getRequestURI()

This method is not documented.
Return
wild

public function getAbsoluteRequestURI()

This method is not documented.
Return
wild

public function isDialogFormPost()

This method is not documented.
Return
wild

public function getRemoteAddress()

This method is not documented.
Return
wild

public function isHTTPS()

This method is not documented.
Return
wild

public function isContinueRequest()

This method is not documented.
Return
wild

public function isPreviewRequest()

This method is not documented.
Return
wild

public function getPassthroughRequestParameters($include_quicksand)

Get application request parameters in a flattened form suitable for inclusion in an HTTP request, excluding parameters with special meanings. This is primarily useful if you want to ask the user for more input and then resubmit their request.

Parameters
$include_quicksand
Return
dict<string, string>Original request parameters.

public function getPassthroughRequestData($include_quicksand)

Get request data other than "magic" parameters.

Parameters
$include_quicksand
Return
dict<string, wild>Request data, with magic filtered out.

public static function flattenData($data)

Flatten an array of key-value pairs (possibly including arrays as values) into a list of key-value pairs suitable for submitting via HTTP request (with arrays flattened).

Parameters
dict<string,$datawild> Data to flatten.
Return
dict<string, string>Flat data suitable for inclusion in an HTTP request.

public static function getHTTPHeader($name, $default, $data)

Read the value of an HTTP header from $_SERVER, or a similar datasource.

This function accepts a canonical header name, like "Accept-Encoding", and looks up the appropriate value in $_SERVER (in this case, "HTTP_ACCEPT_ENCODING").

Parameters
string$nameCanonical header name, like `"Accept-Encoding"`.
wild$defaultDefault value to return if header is not present.
array?$dataRead this instead of `$_SERVER`.
Return
string|wildHeader value if present, or `$default` if not.

public function isProxiedClusterRequest()

Is this a proxied request originating from within the Phabricator cluster?

IMPORTANT: This means the request is dangerous!

These requests are more dangerous than normal requests (they can not be safely proxied, because proxying them may cause a loop). Cluster requests are not guaranteed to come from a trusted source, and should never be treated as safer than normal requests. They are strictly less safe.

Return
wild

public function newClusterProxyFuture($uri)

Build a new HTTPSFuture which proxies this request to another node in the cluster.

IMPORTANT: This is very dangerous!

The future forwards authentication information present in the request. Proxied requests must only be sent to trusted hosts. (We attempt to enforce this.)

This is not a general-purpose proxying method; it is a specialized method with niche applications and severe security implications.

Parameters
string$uriURI identifying the host we are proxying the request to.
Return
HTTPSFutureNew proxy future.