本文整理汇总了PHP中wfCheckLimits函数的典型用法代码示例。如果您正苦于以下问题:PHP wfCheckLimits函数的具体用法?PHP wfCheckLimits怎么用?PHP wfCheckLimits使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wfCheckLimits函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLimitOffset
/**
* FIXME MW 1.24 wfCheckLimits was deprecated in MediaWiki 1.24
*/
private function getLimitOffset()
{
if (method_exists($this->getRequest(), 'getLimitOffset')) {
return $this->getRequest()->getLimitOffset();
}
return wfCheckLimits();
}
示例2: execute
public function execute($parameters)
{
global $wgOut, $wgRequest, $wgDisableTextSearch, $wgScript;
$this->setHeaders();
list($limit, $offset) = wfCheckLimits();
$wgOut->addWikiText(wfMsgForContentNoTrans('proofreadpage_specialpage_text'));
$this->searchList = null;
$this->searchTerm = $wgRequest->getText('key');
$this->suppressSqlOffset = false;
if (!$wgDisableTextSearch) {
$self = $this->getTitle();
$wgOut->addHTML(Xml::openElement('form', array('action' => $wgScript)) . Html::hidden('title', $this->getTitle()->getPrefixedText()) . Xml::input('limit', false, $limit, array('type' => 'hidden')) . Xml::openElement('fieldset') . Xml::element('legend', null, wfMsg('proofreadpage_specialpage_legend')) . Xml::input('key', 20, $this->searchTerm) . ' ' . Xml::submitButton(wfMsg('ilsubmit')) . Xml::closeElement('fieldset') . Xml::closeElement('form'));
if ($this->searchTerm) {
$index_namespace = $this->index_namespace;
$index_ns_index = MWNamespace::getCanonicalIndex(strtolower(str_replace(' ', '_', $index_namespace)));
$searchEngine = SearchEngine::create();
$searchEngine->setLimitOffset($limit, $offset);
$searchEngine->setNamespaces(array($index_ns_index));
$searchEngine->showRedirects = false;
$textMatches = $searchEngine->searchText($this->searchTerm);
$escIndex = preg_quote($index_namespace, '/');
$this->searchList = array();
while ($result = $textMatches->next()) {
$title = $result->getTitle();
if ($title->getNamespace() == $index_ns_index) {
array_push($this->searchList, $title->getDBkey());
}
}
$this->suppressSqlOffset = true;
}
}
parent::execute($parameters);
}
示例3: execute
function execute($query)
{
$this->setHeaders();
list($limit, $offset) = wfCheckLimits();
$rep = new TemplatesPage();
$rep->execute($query);
}
示例4: __construct
function __construct($name = 'Newcontributors')
{
parent::__construct($name);
list($limit, $offset) = wfCheckLimits();
$this->limit = $limit;
$this->offset = $offset;
}
示例5: execute
function execute($query)
{
$this->setHeaders();
list($limit, $offset) = wfCheckLimits();
$rep = new FormsPage();
return $rep->execute($query);
}
示例6: wfSpecialNewpages
/**
* constructor
*/
function wfSpecialNewpages($par, $specialPage)
{
global $wgRequest;
list($limit, $offset) = wfCheckLimits();
if ($par) {
$bits = preg_split('/\\s*,\\s*/', trim($par));
foreach ($bits as $bit) {
if ('shownav' == $bit) {
$shownavigation = 1;
}
if (is_numeric($bit)) {
$limit = $bit;
}
if (preg_match('/^limit=(\\d+)$/', $bit, $m)) {
$limit = intval($m[1]);
}
if (preg_match('/^offset=(\\d+)$/', $bit, $m)) {
$offset = intval($m[1]);
}
}
}
if (!isset($shownavigation)) {
$shownavigation = !$specialPage->including();
}
$npp = new NewPagesPage();
if (!$npp->doFeed($wgRequest->getVal('feed'))) {
$npp->doQuery($offset, $limit, $shownavigation);
}
}
示例7: wfSpecialNamesLog
/**
* constructor
*/
function wfSpecialNamesLog($par, $specialPage)
{
list($limit, $offset) = wfCheckLimits();
if ($par) {
$bits = preg_split('/\\s*,\\s*/', trim($par));
foreach ($bits as $bit) {
if ('shownav' == $bit) {
$shownavigation = true;
}
if (is_numeric($bit)) {
$limit = $bit;
}
if (preg_match('/^limit=(\\d+)$/', $bit, $m)) {
$limit = intval($m[1]);
}
if (preg_match('/^offset=(\\d+)$/', $bit, $m)) {
$offset = intval($m[1]);
}
}
}
if (!isset($shownavigation)) {
$shownavigation = !$specialPage->including();
}
$rg = new NamesLog();
$rg->doQuery($offset, $limit, $shownavigation);
}
示例8: execute
function execute($par)
{
global $wgOut;
$wgOut->setHTMLTitle(wfMsg('accuracypatrol'));
list($limit, $offset) = wfCheckLimits();
$llr = new ListAccuracyPatrol();
return $llr->doQuery($offset, $limit);
}
示例9: wfSpecialWithoutinterwiki
function wfSpecialWithoutinterwiki()
{
global $wgRequest;
list($limit, $offset) = wfCheckLimits();
$prefix = $wgRequest->getVal('prefix');
$wip = new WithoutInterwikiPage();
$wip->setPrefix($prefix);
$wip->doQuery($offset, $limit);
}
示例10: smwfDoSpecialProperties
function smwfDoSpecialProperties()
{
wfProfileIn('smwfDoSpecialProperties (SMW)');
list($limit, $offset) = wfCheckLimits();
$rep = new SMWPropertiesPage();
$result = $rep->doQuery($offset, $limit);
wfProfileOut('smwfDoSpecialProperties (SMW)');
return $result;
}
示例11: wfSpecialUnwatchedpages
/**
* constructor
*/
function wfSpecialUnwatchedpages()
{
global $wgUser, $wgOut;
if (!$wgUser->isAllowed('unwatchedpages')) {
return $wgOut->permissionRequired('unwatchedpages');
}
list($limit, $offset) = wfCheckLimits();
$wpp = new UnwatchedpagesPage();
$wpp->doQuery($offset, $limit);
}
示例12: wfSpecialWithoutinterwiki
function wfSpecialWithoutinterwiki()
{
global $wgRequest, $wgContLang;
list($limit, $offset) = wfCheckLimits();
// Only searching the mainspace anyway
$prefix = Title::capitalize($wgRequest->getVal('prefix'), NS_MAIN);
$wip = new WithoutInterwikiPage();
$wip->setPrefix($prefix);
$wip->doQuery($offset, $limit);
}
示例13: wfSpecialPopularpages
/**
* Constructor
*/
function wfSpecialPopularpages()
{
global $wgOut;
list($limit, $offset) = wfCheckLimits();
$wgOut->setRobotPolicy("index,follow");
$ppp = new PopularPagesPage();
if ($limit != 50 || $offset != 0) {
$wgOut->setPageTitle(wfMsg('popularpages_range', $offset + 1, $offset + $limit));
}
return $ppp->doQuery($offset, $limit);
}
示例14: execute
function execute( $par ) {
$this->setHeaders();
list( $limit, $offset ) = wfCheckLimits();
$rep = new FiltersPage();
// Handling changed in MW version 1.18.
if ( method_exists( $rep, 'execute' ) ) {
return $rep->execute( $par );
} else {
return $rep->doQuery( $offset, $limit );
}
}
示例15: execute
function execute( $query ) {
$this->setHeaders();
list( $limit, $offset ) = wfCheckLimits();
$rep = new TemplatesPage();
// execute() method added in MW 1.18
if ( method_exists( $rep, 'execute' ) ) {
$rep->execute( $query );
} else {
return $rep->doQuery( $offset, $limit );
}
}