/**
  * Load the blocks from the database and save them to memcached
  *  @param bool $bFromSlave Whether to load data from slaves or master
  */
 function loadFromDB($bFromSlave = false)
 {
     global $wgUseMemCached, $wgMemc;
     $this->mData = array();
     # Selecting FOR UPDATE is a convenient way to serialise the memcached and DB operations,
     # which is necessary even though we don't update the DB
     if (!$bFromSlave) {
         Block::enumBlocks('wfBlockCacheInsert', '', EB_FOR_UPDATE);
         #$wgMemc->set( $this->mMemcKey, $this->mData, 0 );
     } else {
         Block::enumBlocks('wfBlockCacheInsert', '');
     }
 }
Beispiel #2
0
 function showList($msg)
 {
     global $wgOut;
     $wgOut->setPagetitle(wfMsg("ipblocklist"));
     if ("" != $msg) {
         $wgOut->setSubtitle($msg);
     }
     global $wgRequest;
     list($this->limit, $this->offset) = $wgRequest->getLimitOffset();
     $this->counter = 0;
     $paging = '<p>' . wfViewPrevNext($this->offset, $this->limit, Title::makeTitle(NS_SPECIAL, 'Ipblocklist'), 'ip=' . urlencode($this->ip)) . "</p>\n";
     $wgOut->addHTML($paging);
     $search = $this->searchForm();
     $wgOut->addHTML($search);
     $wgOut->addHTML("<ul>");
     if (!Block::enumBlocks(array(&$this, "addRow"), 0)) {
         // FIXME hack to solve #bug 1487
         $wgOut->addHTML('<li>' . wfMsgHtml('ipblocklistempty') . '</li>');
     }
     $wgOut->addHTML("</ul>\n");
     $wgOut->addHTML($paging);
 }
 function showList($msg)
 {
     global $wgOut;
     $wgOut->setPagetitle(wfMsg("ipblocklist"));
     if ("" != $msg) {
         $wgOut->setSubtitle($msg);
     }
     $wgOut->addHTML("<ul>");
     // FIXME hack to solve #bug 1487
     if (!Block::enumBlocks("wfAddRow", 0)) {
         $wgOut->addHTML('<li>' . wfMsg('ipblocklistempty') . '</li>');
     }
     $wgOut->addHTML("</ul>\n");
 }
 function showList($msg)
 {
     global $wgOut;
     $wgOut->setPagetitle(wfMsg("ipblocklist"));
     if ("" != $msg) {
         $wgOut->setSubtitle($msg);
     }
     $wgOut->addHTML("<ul>");
     Block::enumBlocks("wfAddRow", 0);
     $wgOut->addHTML("</ul>\n");
 }