本文整理汇总了PHP中WebRequest::getLimitOffset方法的典型用法代码示例。如果您正苦于以下问题:PHP WebRequest::getLimitOffset方法的具体用法?PHP WebRequest::getLimitOffset怎么用?PHP WebRequest::getLimitOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebRequest
的用法示例。
在下文中一共展示了WebRequest::getLimitOffset方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SpecialSearch
/**
* Set up basic search parameters from the request and user settings.
* Typically you'll pass $wgRequest and $wgUser.
*
* @param WebRequest $request
* @param User $user
* @access public
*/
function SpecialSearch(&$request, &$user)
{
list($this->limit, $this->offset) = $request->getLimitOffset(20, 'searchlimit');
if ($request->getCheck('searchx')) {
$this->namespaces = $this->powerSearch($request);
} else {
$this->namespaces = $this->userNamespaces($user);
}
$this->searchRedirects = false;
}
示例2: setupQuery
/**
* Basic setup and applies the limiting factors from the WebRequest object.
* @param WebRequest $request
* @private
*/
function setupQuery($request)
{
$page = $this->db->tableName('page');
$user = $this->db->tableName('user');
$this->joinClauses = array("LEFT OUTER JOIN {$page} ON log_namespace=page_namespace AND log_title=page_title");
$this->whereClauses = array('user_id=log_user');
$this->limitType($request->getVal('type'));
$this->limitUser($request->getText('user'));
$this->limitTitle($request->getText('page'));
$this->limitTime($request->getVal('from'), '>=');
$this->limitTime($request->getVal('until'), '<=');
list($this->limit, $this->offset) = $request->getLimitOffset();
}
示例3: list
/**
* Set up basic search parameters from the request and user settings.
* Typically you'll pass $wgRequest and $wgUser.
*
* @param WebRequest $request
* @param User $user
* @public
*/
function __construct(&$request, &$user)
{
list($this->limit, $this->offset) = $request->getLimitOffset(20, 'searchlimit');
$this->mPrefix = $request->getVal('prefix', '');
# Extract requested namespaces
$this->namespaces = $this->powerSearch($request);
if (empty($this->namespaces)) {
$this->namespaces = SearchEngine::userNamespaces($user);
}
$this->searchRedirects = $request->getcheck('redirs') ? true : false;
$this->searchAdvanced = $request->getVal('advanced');
$this->active = 'advanced';
$this->sk = $user->getSkin();
$this->didYouMeanHtml = '';
# html of did you mean... link
$this->fulltext = $request->getVal('fulltext');
}
示例4: setupQuery
/**
* Basic setup and applies the limiting factors from the WebRequest object.
* @param WebRequest $request
* @private
*/
function setupQuery($request)
{
$page = $this->db->tableName('page');
$user = $this->db->tableName('user');
$this->joinClauses = array("LEFT OUTER JOIN {$page} ON log_namespace=page_namespace AND log_title=page_title", "INNER JOIN {$user} ON user_id=log_user");
$this->whereClauses = array();
$this->limitType($request->getVal('type'));
$this->limitUser($request->getText('user'));
$this->limitTitle($request->getText('page'), $request->getBool('pattern'));
$this->limitTime($request->getVal('from'), '>=');
$this->limitTime($request->getVal('until'), '<=');
list($this->limit, $this->offset) = $request->getLimitOffset();
// XXX This all needs to use Pager, ugly hack for now.
global $wgMiserMode;
if ($wgMiserMode) {
$this->offset = min($this->offset, 10000);
}
}
示例5: list
/**
* Set up basic search parameters from the request and user settings.
* Typically you'll pass $wgRequest and $wgUser.
*
* @param WebRequest $request
* @param User $user
* @public
*/
function __construct(&$request, &$user)
{
list($this->limit, $this->offset) = $request->getLimitOffset(20, 'searchlimit');
$this->mPrefix = $request->getVal('prefix', '');
$this->namespaces = $this->powerSearch($request);
if (empty($this->namespaces)) {
$this->namespaces = SearchEngine::userNamespaces($user);
}
$this->searchRedirects = $request->getcheck('redirs') ? true : false;
}