Example #1
0
 /**
  * @author Federico "Lox" Lucignano
  *
  * Factory method
  *
  * @param Title $title a Title class instance for the article
  * @param boolean $skipPhalanxCheck a flag informs to check Phalanx or not
  *
  * @return TopList|bool|mixed a TopList instance, false in case $title is not in the NS_TOPLIST namespace
  */
 public static function newFromTitle(Title $title, $skipPhalanxCheck = false)
 {
     global $wgMemc;
     //FB#16388: we don't need to check Phalanx blocks while deleting
     if (!$skipPhalanxCheck) {
         //FB#8083: blocked titles are not being filtered, this should be handled automatically by Phalanx though...
         $notPhalanxBlocked = TitleBlock::checkTitle($title);
     } else {
         $notPhalanxBlocked = true;
     }
     if ($title->getNamespace() == NS_TOPLIST && !$title->isSubpage() && $notPhalanxBlocked) {
         $list = new self();
         $list->mTitle = $title;
         //needed to let getItems fetch fresh data when instantiating more tha once with the same title object
         $wgMemc->set($list->_getNeedRefreshCacheKey(), true);
         return $list;
     }
     return false;
 }