|
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) |
| 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) |
| 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) |
| 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 |
Definition at line 344 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") |
Definition at line 326 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 |
Definition at line 66 of file CoreMagicVariables.php.
References MediaWiki\Parser\Parser\getOutput().