Function __global->get_cache_entry

Definitions

sources/caches.php

  • Find the cached result of what is named by codename and the further constraints.This will use persistent cache if enabled, else the database.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$codename ID_TEXT No No required parameter N/A N/A The codename to check for caching
$cache_identifier LONG_TEXT No No required parameter N/A N/A The further restraints (a serialized map)
$special_cache_flags integer No No 24 N/A N/A Special cache flags
$ttl integer No No 10000 N/A N/A The TTL for the cache entry in minutes. Defaults to a very big ttl
$tempcode boolean No No False N/A N/A Whether we are caching Tempcode (needs special care)
$caching_via_cron boolean No No False N/A N/A Whether to defer caching to the system scheduler. Note that this option only works if the block's defined cache signature depends only on $map (timezone and bot-type are automatically considered)
$map array No No [] N/A N/A Parameters to call up block with if we have to defer caching

Returns

  • The cached result (null: no cached result)
  • Type: ?mixed
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Find the cached result of what is named by codename and the further constraints.This will use persistent cache if enabled, else the database.
 *
 * @param  ID_TEXT $codename The codename to check for caching
 * @param  LONG_TEXT $cache_identifier The further restraints (a serialized map)
 * @param  integer $special_cache_flags Special cache flags
 * @param  integer $ttl The TTL for the cache entry in minutes. Defaults to a very big ttl
 * @param  boolean $tempcode Whether we are caching Tempcode (needs special care)
 * @param  boolean $caching_via_cron Whether to defer caching to the system scheduler. Note that this option only works if the block's defined cache signature depends only on $map (timezone and bot-type are automatically considered)
 * @param  array $map Parameters to call up block with if we have to defer caching
 * @return ?mixed The cached result (null: no cached result)
 */

function get_cache_entry(string $codename, string $cache_identifier, int $special_cache_flags = 24, int $ttl = 10000, bool $tempcode = false, bool $caching_via_cron = false, array $map = [])