Page MenuHomePhorge
Diviner Tech Docs PhabricatorCaches

final class PhabricatorCaches
Phorge Technical Documentation (Cache)

This class is not documented.

Tasks

Request Cache

No methods for this task.

Immutable Cache

Setup Cache

  • public static function getServerStateCache() — Highly specialized cache for storing server process state.
  • public static function getSetupCache() — Highly specialized cache for performing setup checks. We use this cache to determine if we need to run expensive setup checks when the page loads. Without it, we would need to run these checks every time.
  • private static function buildSetupCaches($cache_name)
  • private static function getSetupCacheDiskCachePath($name)
  • private static function testTemporaryDirectory($dir)

Compression

  • public static function maybeDeflateData($value) — Deflate a value, if deflation is available and has an impact.
  • public static function inflateData($value) — Inflate data previously deflated by @{method:maybeDeflateData}.

Other Methods

Methods

public function __get($name)
Inherited

This method is not documented.
Parameters
$name
Return
wild

public function __set($name, $value)
Inherited

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

public function current()
Inherited

This method is not documented.
Return
wild

public function key()
Inherited

This method is not documented.
Return
wild

public function next()
Inherited

This method is not documented.
Return
wild

public function rewind()
Inherited

This method is not documented.
Return
wild

public function valid()
Inherited

This method is not documented.
Return
wild

private function throwOnAttemptedIteration()
Inherited

This method is not documented.
Return
wild

public function getPhobjectClassConstant($key, $byte_limit)
Inherited

Phobject

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.

Parameters
string$keyName of the constant.
int|null$byte_limitMaximum number of bytes permitted in the value.
Return
stringValue of the constant.

public static function getNamespace()

This method is not documented.
Return
wild

private static function newStackFromCaches($caches)

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

public static function getRequestCache()

Get a request cache stack.

This cache stack is destroyed after each logical request. In particular, it is destroyed periodically by the daemons, while static caches are not.

Return
PhutilKeyValueCacheStackRequest cache stack.

public static function destroyRequestCache()

Destroy the request cache.

This is called at the beginning of each logical request.

Return
void

public static function getImmutableCache()

Gets an immutable cache stack.

This stack trades mutability away for improved performance. Normally, it is APC + DB.

In the general case with multiple web frontends, this stack can not be cleared, so it is only appropriate for use if the value of a given key is permanent and immutable.

Return
PhutilKeyValueCacheStackBest immutable stack available.

private static function buildImmutableCaches()

Build the immutable cache stack.

Return
list<PhutilKeyValueCache>List of caches.

public static function getMutableCache()

This method is not documented.
Return
wild

private static function buildMutableCaches()

This method is not documented.
Return
wild

public static function getMutableStructureCache()

This method is not documented.
Return
wild

private static function buildMutableStructureCaches()

This method is not documented.
Return
wild

public static function getRuntimeCache()

Get a runtime cache stack.

This stack is just APC. It's fast, it's effectively immutable, and it gets thrown away when the webserver restarts.

This cache is suitable for deriving runtime caches, like a map of Conduit method names to provider classes.

Return
PhutilKeyValueCacheStackBest runtime stack available.

private static function buildRuntimeCaches()

This method is not documented.
Return
wild

public static function getRepositoryGraphL1Cache()

This method is not documented.
Return
wild

private static function buildRepositoryGraphL1Caches()

This method is not documented.
Return
wild

public static function getRepositoryGraphL2Cache()

This method is not documented.
Return
wild

private static function buildRepositoryGraphL2Caches()

This method is not documented.
Return
wild

public static function getServerStateCache()

Highly specialized cache for storing server process state.

We use this cache to track initial steps in the setup phase, before configuration is loaded.

This cache does NOT use the cache namespace (it must be accessed before we build configuration), and is global across all instances on the host.

Return
PhutilKeyValueCacheStackBest available server state cache stack.

public static function getSetupCache()

Highly specialized cache for performing setup checks. We use this cache to determine if we need to run expensive setup checks when the page loads. Without it, we would need to run these checks every time.

Normally, this cache is just APC. In the absence of APC, this cache degrades into a slow, quirky on-disk cache.

NOTE: Do not use this cache for anything else! It is not a general-purpose cache!
Return
PhutilKeyValueCacheStackMost qualified available cache stack.

private static function buildSetupCaches($cache_name)

This method is not documented.
Parameters
$cache_name
Return
wild

private static function getSetupCacheDiskCachePath($name)

This method is not documented.
Parameters
$name
Return
wild

private static function testTemporaryDirectory($dir)

This method is not documented.
Parameters
$dir
Return
wild

private static function addProfilerToCaches($caches)

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

private static function addNamespaceToCaches($caches)

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

public static function maybeDeflateData($value)

Deflate a value, if deflation is available and has an impact.

If the value is larger than 1KB, we have gzdeflate(), we successfully can deflate it, and it benefits from deflation, we deflate it. Otherwise we leave it as-is.

Data can later be inflated with inflateData().

Parameters
string$valueString to attempt to deflate.
Return
string|nullDeflated string, or null if it was not deflated.

public static function inflateData($value)

Inflate data previously deflated by maybeDeflateData().

Parameters
string$valueDeflated data, from @{method:maybeDeflateData}.
Return
stringOriginal, uncompressed data.