|
MediaWiki master
|
Expansions of core magic variables, used by the parser. More...
Static Public Member Functions | |
| static | applyCacheExpiry (Parser $parser, int $ttl, ?int $stagger=null, ?string $source=null) |
| Apply the given $ttl to the cache expiry of the parser output, adjusting slightly to ensure a minimum TTL and avoid cache stampede. | |
| static | applyUnitTimestampDeadline (Parser $parser, ?ConvertibleTimestamp $ts, string $unit, ?string $source=null) |
| Adjust the cache expiry to account for a dynamic timestamp displayed in output. | |
| static | expand (Parser $parser, string $id, ConvertibleTimestamp $ts, ServiceOptions $svcOptions, LoggerInterface $logger, $frame=false) |
| Expand the magic variable given by $index. | |
Expansions of core magic variables, used by the parser.
Definition at line 26 of file CoreMagicVariables.php.
|
static |
Apply the given $ttl to the cache expiry of the parser output, adjusting slightly to ensure a minimum TTL and avoid cache stampede.
| Parser | $parser | |
| int | $ttl | The desired time-to-live, in seconds |
| ?int | $stagger | An optional random value used to avoid stampede |
| string | null | $source | Cache-expiry attribution label |
Definition at line 353 of file CoreMagicVariables.php.
|
static |
Adjust the cache expiry to account for a dynamic timestamp displayed in output.
| Parser | $parser | |
| ?ConvertibleTimestamp | $ts | Current timestamp with the display timezone. If missing (null) the timestamp will be fetched from the ParserOptions. |
| string | $unit | The unit the timestamp is expressed in; one of ("Y", "M", "D", "H") |
| string | null | $source | Cache-expiry attribution label |
Definition at line 333 of file CoreMagicVariables.php.
|
static |
Expand the magic variable given by $index.
| Parser | $parser | |
| string | $id | The name of the variable, and equivalently, the magic word ID which was used to match the variable |
| ConvertibleTimestamp | $ts | Timestamp to use when expanding magic variable |
| ServiceOptions | $svcOptions | Service options for the parser |
| LoggerInterface | $logger | |
| PPFrame | false | $frame | The current parser frame, used to attribute cache-expiry changes to the page/template that triggered them. |
Definition at line 68 of file CoreMagicVariables.php.
References $source, and MediaWiki\Parser\Parser\getOutput().