public static function initializeWebEnvironment()
| wild |
public static function initializeScriptEnvironment($config_optional)
| $config_optional |
| wild |
private static function initializeCommonEnvironment($config_optional)
| $config_optional |
| wild |
public static function beginScopedLocale($locale_code)
| $locale_code |
| wild |
public static function getLocaleCode()
| wild |
public static function setLocaleCode($locale_code)
| $locale_code |
| wild |
private static function buildConfigurationSourceStack($config_optional)
| $config_optional |
| wild |
public static function repairConfig($key, $value)
| $key | ||
| $value |
| wild |
public static function overrideConfig($key, $value)
| $key | ||
| $value |
| wild |
public static function getUnrepairedEnvConfig($key, $default)
| $key | ||
| $default |
| wild |
public static function getSelectedEnvironmentName()
| wild |
public static function getEnvConfig($key)
Get the current configuration setting for a given key.
If the key is not found, then throw an Exception.
| $key |
| wild |
public static function getEnvConfigIfExists($key, $default)
Get the current configuration setting for a given key. If the key does not exist, return a default value instead of throwing. This is primarily useful for migrations involving keys which are slated for removal.
| $key | ||
| $default |
| wild |
public static function getURI($path)
Get the fully-qualified URI for a path.
| $path |
| wild |
public static function getProductionURI($path)
Get the fully-qualified production URI for a path.
| $path |
| wild |
public static function isSelfURI($raw_uri)
| $raw_uri |
| wild |
private static function getSelfURIMap()
| wild |
public static function getCDNURI($path)
Get the fully-qualified production URI for a static resource path.
| $path |
| wild |
public static function getDoclink($resource, $type)
Get the fully-qualified production URI for a documentation resource.
| $resource | ||
| $type |
| wild |
public static function newObjectFromConfig($key, $args)
Build a concrete object from a configuration key.
| $key | ||
| $args |
| wild |
public static function getAnyBaseURI()
| wild |
public static function getRequestBaseURI()
| wild |
public static function setRequestBaseURI($uri)
| $uri |
| wild |
public static function isReadOnly()
| wild |
public static function setReadOnly($read_only, $reason)
| $read_only | ||
| $reason |
| wild |
public static function getReadOnlyMessage()
| wild |
public static function getReadOnlyURI()
| wild |
public static function getReadOnlyReason()
| wild |
public static function beginScopedEnv()
| wild |
private static function pushTestEnvironment()
| wild |
public static function popTestEnvironment($key)
| $key |
| wild |
public static function isValidURIForLink($uri)
Detect if a URI satisfies either isValidLocalURIForLink() or isValidRemoteURIForLink(), i.e. is a page on this server or the URI of some other resource which has a valid protocol. This rejects garbage URIs and URIs with protocols which do not appear in the uri.allowed-protocols configuration, notably 'javascript:' URIs.
| string | $uri | URI to test. |
| bool | True if the URI identifies a web resource. |
public static function isValidLocalURIForLink($uri)
Detect if a URI identifies some page on this server.
| string | $uri | URI to test. |
| bool | True if the URI identifies a local page. |
public static function isValidRemoteURIForLink($uri)
Detect if a URI identifies some valid linkable remote resource.
| string | $uri | URI to test. |
| bool | True if a URI identifies a remote resource with an allowed protocol. |
public static function requireValidRemoteURIForLink($raw_uri)
Detect if a URI identifies a valid linkable remote resource, throwing a detailed message if it does not.
A valid linkable remote resource can be safely linked or redirected to. This is primarily a protocol whitelist check.
| string | $raw_uri | URI to test. |
| void |
public static function isValidRemoteURIForFetch($uri, $protocols)
Detect if a URI identifies a valid fetchable remote resource.
| string | $uri | URI to test. |
| list<string> | $protocols | Allowed protocols. |
| bool | True if the URI is a valid fetchable remote resource. |
public static function requireValidRemoteURIForFetch($raw_uri, $protocols)
Detect if a URI identifies a valid fetchable remote resource, throwing a detailed message if it does not.
A valid fetchable remote resource can be safely fetched using a request originating on this server. This is a primarily an address check against the outbound address blacklist.
| string | $raw_uri | URI to test. |
| list<string> | $protocols | Allowed protocols. |
| pair<string, string> | Pre-resolved URI and domain. |
public static function isBlacklistedOutboundAddress($address)
Determine if an IP address is in the outbound address blacklist.
| string | $address | IP address. |
| bool | True if the address is blacklisted. |
public static function isClusterRemoteAddress()
| wild |
public static function isClusterAddress($address)
| $address |
| wild |
public static function getRemoteAddress()
| wild |
public static function envConfigExists($key)
| $key |
| wild |
public static function getAllConfigKeys()
| wild |
public static function getConfigSourceStack()
| wild |
public static function overrideTestEnvConfig($stack_key, $key, $value)
| $stack_key | ||
| $key | ||
| $value |
| wild |
private static function dropConfigCache()
| wild |
private static function resetUmask()
| wild |
public static function getEmptyCWD()
Get the path to an empty directory which is readable by all of the system user accounts that Phabricator acts as.
In some cases, a binary needs some valid HOME or CWD to continue, but not all user accounts have valid home directories and even if they do they may not be readable after a sudo operation.
| string | Path to an empty directory suitable for use as a CWD. |