MediaWiki  master
CacheKeyHelper.php
Go to the documentation of this file.
1 <?php
22 namespace MediaWiki\Cache;
23 
24 use LogicException;
27 
43 abstract class CacheKeyHelper {
44 
49  private function __construct() {
50  // we should never even get here...
51  throw new LogicException( 'Should not instantiate ' . __CLASS__ );
52  }
53 
59  public static function getKeyForPage( $page ): string {
60  return 'ns' . $page->getNamespace() . ':' . $page->getDBkey();
61  }
62 }
MediaWiki\Cache
Definition: BacklinkCacheFactory.php:24
Page\PageReference
Interface for objects (potentially) representing a page that can be viewable and linked to on a wiki.
Definition: PageReference.php:49
MediaWiki\Cache\CacheKeyHelper\getKeyForPage
static getKeyForPage( $page)
Definition: CacheKeyHelper.php:59
MediaWiki\Cache\CacheKeyHelper
Helper class for mapping value objects representing basic entities to cache keys.
Definition: CacheKeyHelper.php:43
MediaWiki\Linker\LinkTarget
Definition: LinkTarget.php:26
MediaWiki\Cache\CacheKeyHelper\__construct
__construct()
Private constructor to defy instantiation.
Definition: CacheKeyHelper.php:49