}
$pageSet->requestField( 'page_is_new' );
$config = $this->getConfig();
- if ( !$config->get( 'DisableCounters' ) ) {
- $pageSet->requestField( 'page_counter' );
- }
$pageSet->requestField( 'page_touched' );
$pageSet->requestField( 'page_latest' );
$pageSet->requestField( 'page_len' );
* Get an array mapping token names to their handler functions.
* The prototype for a token function is func($pageid, $title)
* it should return a token or false (permission denied)
+ * @deprecated since 1.24
* @return array Array(tokenname => function)
*/
protected function getTokenFunctions() {
static protected $cachedTokens = array();
+ /**
+ * @deprecated since 1.24
+ */
public static function resetTokenCache() {
ApiQueryInfo::$cachedTokens = array();
}
+ /**
+ * @deprecated since 1.24
+ */
public static function getEditToken( $pageid, $title ) {
// We could check for $title->userCan('edit') here,
// but that's too expensive for this purpose
return ApiQueryInfo::$cachedTokens['edit'];
}
+ /**
+ * @deprecated since 1.24
+ */
public static function getDeleteToken( $pageid, $title ) {
global $wgUser;
if ( !$wgUser->isAllowed( 'delete' ) ) {
return ApiQueryInfo::$cachedTokens['delete'];
}
+ /**
+ * @deprecated since 1.24
+ */
public static function getProtectToken( $pageid, $title ) {
global $wgUser;
if ( !$wgUser->isAllowed( 'protect' ) ) {
return ApiQueryInfo::$cachedTokens['protect'];
}
+ /**
+ * @deprecated since 1.24
+ */
public static function getMoveToken( $pageid, $title ) {
global $wgUser;
if ( !$wgUser->isAllowed( 'move' ) ) {
return ApiQueryInfo::$cachedTokens['move'];
}
+ /**
+ * @deprecated since 1.24
+ */
public static function getBlockToken( $pageid, $title ) {
global $wgUser;
if ( !$wgUser->isAllowed( 'block' ) ) {
return ApiQueryInfo::$cachedTokens['block'];
}
+ /**
+ * @deprecated since 1.24
+ */
public static function getUnblockToken( $pageid, $title ) {
// Currently, this is exactly the same as the block token
return self::getBlockToken( $pageid, $title );
}
+ /**
+ * @deprecated since 1.24
+ */
public static function getEmailToken( $pageid, $title ) {
global $wgUser;
if ( !$wgUser->canSendEmail() || $wgUser->isBlockedFromEmailUser() ) {
return ApiQueryInfo::$cachedTokens['email'];
}
+ /**
+ * @deprecated since 1.24
+ */
public static function getImportToken( $pageid, $title ) {
global $wgUser;
if ( !$wgUser->isAllowedAny( 'import', 'importupload' ) ) {
return ApiQueryInfo::$cachedTokens['import'];
}
+ /**
+ * @deprecated since 1.24
+ */
public static function getWatchToken( $pageid, $title ) {
global $wgUser;
if ( !$wgUser->isLoggedIn() ) {
return ApiQueryInfo::$cachedTokens['watch'];
}
+ /**
+ * @deprecated since 1.24
+ */
public static function getOptionsToken( $pageid, $title ) {
global $wgUser;
if ( !$wgUser->isLoggedIn() ) {
: array();
$this->pageIsNew = $pageSet->getCustomField( 'page_is_new' );
- if ( !$this->getConfig()->get( 'DisableCounters' ) ) {
- $this->pageCounter = $pageSet->getCustomField( 'page_counter' );
- }
$this->pageTouched = $pageSet->getCustomField( 'page_touched' );
$this->pageLatest = $pageSet->getCustomField( 'page_latest' );
$this->pageLength = $pageSet->getCustomField( 'page_len' );
if ( $titleExists ) {
$pageInfo['touched'] = wfTimestamp( TS_ISO_8601, $this->pageTouched[$pageid] );
$pageInfo['lastrevid'] = intval( $this->pageLatest[$pageid] );
- $pageInfo['counter'] = $this->getConfig()->get( 'DisableCounters' )
- ? ''
- : intval( $this->pageCounter[$pageid] );
$pageInfo['length'] = intval( $this->pageLength[$pageid] );
if ( isset( $this->pageIsRedir[$pageid] ) && $this->pageIsRedir[$pageid] ) {
if ( $this->fld_url ) {
$pageInfo['fullurl'] = wfExpandUrl( $title->getFullURL(), PROTO_CURRENT );
$pageInfo['editurl'] = wfExpandUrl( $title->getFullURL( 'action=edit' ), PROTO_CURRENT );
+ $pageInfo['canonicalurl'] = wfExpandUrl( $title->getFullURL(), PROTO_CANONICAL );
}
if ( $this->fld_readable && $title->userCan( 'read', $this->getUser() ) ) {
$pageInfo['readable'] = '';
// need to be added to getCacheMode()
) ),
'token' => array(
+ ApiBase::PARAM_DEPRECATED => true,
ApiBase::PARAM_DFLT => null,
ApiBase::PARAM_ISMULTI => true,
ApiBase::PARAM_TYPE => array_keys( $this->getTokenFunctions() )
),
- 'continue' => null,
- );
- }
-
- public function getParamDescription() {
- return array(
- 'prop' => array(
- 'Which additional properties to get:',
- ' protection - List the protection level of each page',
- ' talkid - The page ID of the talk page for each non-talk page',
- ' watched - List the watched status of each page',
- ' watchers - The number of watchers, if allowed',
- ' notificationtimestamp - The watchlist notification timestamp of each page',
- ' subjectid - The page ID of the parent page for each talk page',
- ' url - Gives a full URL to the page, and also an edit URL',
- ' readable - Whether the user can read this page',
- ' preload - Gives the text returned by EditFormPreloadText',
- ' displaytitle - Gives the way the page title is actually displayed',
+ 'continue' => array(
+ ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
),
- 'token' => 'Request a token to perform a data-modifying action on a page',
- 'continue' => 'When more results are available, use this to continue',
);
}
- public function getDescription() {
- return 'Get basic page information such as namespace, title, last touched date, ...';
- }
-
- public function getExamples() {
+ public function getExamplesMessages() {
return array(
- 'api.php?action=query&prop=info&titles=Main%20Page',
- 'api.php?action=query&prop=info&inprop=protection&titles=Main%20Page'
+ 'action=query&prop=info&titles=Main%20Page'
+ => 'apihelp-query+info-example-simple',
+ 'action=query&prop=info&inprop=protection&titles=Main%20Page'
+ => 'apihelp-query+info-example-protection',
);
}