コード例 #1
0
 /**
  * @param $rootJobParams array
  * @return void
  */
 protected function insertPartitionJobs($rootJobParams = array())
 {
     // Carry over any "root job" information
     $rootJobParams = $this->getRootJobParams();
     $batches = $this->blCache->partition($this->params['table'], $this->rowsPerJob);
     if (!count($batches)) {
         return;
         // no jobs to insert
     }
     $jobs = array();
     foreach ($batches as $batch) {
         list($start, $end) = $batch;
         $jobs[] = new HTMLCacheUpdateJob($this->title, array('table' => $this->params['table'], 'start' => $start, 'end' => $end) + $rootJobParams);
     }
     JobQueueGroup::singleton()->push($jobs);
 }
コード例 #2
0
ファイル: Title.php プロジェクト: MediaWiki-stable/1.26.1
 /**
  * Get a backlink cache object
  *
  * @return BacklinkCache
  */
 public function getBacklinkCache()
 {
     return BacklinkCache::get($this);
 }
コード例 #3
0
 /**
  * Create a new BacklinkCache or reuse any existing one.
  * Currently, only one cache instance can exist; callers that
  * need multiple backlink cache objects should keep them in scope.
  *
  * @param Title $title : Title object to get a backlink cache for
  * @return BacklinkCache
  */
 public static function get(Title $title)
 {
     if (!self::$cache) {
         // init cache
         self::$cache = new ProcessCacheLRU(1);
     }
     $dbKey = $title->getPrefixedDBkey();
     if (!self::$cache->has($dbKey, 'obj')) {
         self::$cache->set($dbKey, 'obj', new self($title));
     }
     return self::$cache->get($dbKey, 'obj');
 }
コード例 #4
0
ファイル: BacklinkCache.php プロジェクト: paladox/mediawiki
 /**
  * Create a new BacklinkCache or reuse any existing one.
  * Currently, only one cache instance can exist; callers that
  * need multiple backlink cache objects should keep them in scope.
  *
  * @param Title $title Title object to get a backlink cache for
  * @return BacklinkCache
  */
 public static function get(Title $title)
 {
     if (!self::$instance || !self::$instance->title->equals($title)) {
         self::$instance = new self($title);
     }
     return self::$instance;
 }