Ejemplo n.º 1
0
 /**
  * Constructs a cache key to use for caching the list of sites.
  *
  * This includes the concrete class name of the site list as well as a version identifier
  * for the list's serialization, to avoid problems when unserializing site lists serialized
  * by an older version, e.g. when reading from a cache.
  *
  * The cache key also includes information about where the sites were loaded from, e.g.
  * the name of a database table.
  *
  * @see SiteList::getSerialVersionId
  *
  * @return String The cache key.
  */
 protected function getCacheKey()
 {
     wfProfileIn(__METHOD__);
     if ($this->cacheKey === null) {
         $type = 'SiteList#' . SiteList::getSerialVersionId();
         $source = $this->sitesTable->getName();
         if ($this->sitesTable->getTargetWiki() !== false) {
             $source = $this->sitesTable->getTargetWiki() . '.' . $source;
         }
         $this->cacheKey = wfMemcKey("{$source}/{$type}");
     }
     wfProfileOut(__METHOD__);
     return $this->cacheKey;
 }