private $pageRestrictions, $pageIsRedir, $pageIsNew, $pageTouched,
$pageLatest, $pageLength;
- private $protections, $watched, $watchers, $notificationtimestamps, $talkids, $subjectids, $displaytitles;
+ private $protections, $watched, $watchers, $notificationtimestamps,
+ $talkids, $subjectids, $displaytitles;
private $showZeroWatchers = false;
private $tokenFunctions;
}
/**
- * @param $pageSet ApiPageSet
+ * @param ApiPageSet $pageSet
* @return void
*/
public function requestExtraData( $pageSet ) {
* 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)
- * @return array array(tokenname => function)
+ * @return array Array(tokenname => function)
*/
protected function getTokenFunctions() {
// Don't call the hooks twice
'watch' => array( 'ApiQueryInfo', 'getWatchToken' ),
);
wfRunHooks( 'APIQueryInfoTokens', array( &$this->tokenFunctions ) );
+
return $this->tokenFunctions;
}
- static $cachedTokens = array();
+ static protected $cachedTokens = array();
public static function resetTokenCache() {
ApiQueryInfo::$cachedTokens = array();
), $pageid, $pageInfo );
if ( !$fit ) {
$this->setContinueEnumParameter( 'continue',
- $title->getNamespace() . '|' .
- $title->getText() );
+ $title->getNamespace() . '|' .
+ $title->getText() );
break;
}
}
/**
* Get a result array with information about a title
* @param int $pageid Page ID (negative for missing titles)
- * @param $title Title object
+ * @param Title $title
* @return array
*/
private function extractPageInfo( $pageid, $title ) {
$pageInfo = array();
- $titleExists = $pageid > 0; //$title->exists() needs pageid, which is not set for all title objects
+ // $title->exists() needs pageid, which is not set for all title objects
+ $titleExists = $pageid > 0;
$ns = $title->getNamespace();
$dbkey = $title->getDBkey();
if ( $this->fld_notificationtimestamp ) {
$pageInfo['notificationtimestamp'] = '';
if ( isset( $this->notificationtimestamps[$ns][$dbkey] ) ) {
- $pageInfo['notificationtimestamp'] = wfTimestamp( TS_ISO_8601, $this->notificationtimestamps[$ns][$dbkey] );
+ $pageInfo['notificationtimestamp'] =
+ wfTimestamp( TS_ISO_8601, $this->notificationtimestamps[$ns][$dbkey] );
}
}
$this->resetQueryParams();
$this->addTables( 'page_restrictions' );
$this->addFields( array( 'pr_page', 'pr_type', 'pr_level',
- 'pr_expiry', 'pr_cascade' ) );
+ 'pr_expiry', 'pr_cascade' ) );
$this->addWhereFld( 'pr_page', array_keys( $this->titles ) );
$res = $this->select( __METHOD__ );
$this->resetQueryParams();
$this->addTables( array( 'page_restrictions', 'page', 'templatelinks' ) );
$this->addFields( array( 'pr_type', 'pr_level', 'pr_expiry',
- 'page_title', 'page_namespace',
- 'tl_title', 'tl_namespace' ) );
+ 'page_title', 'page_namespace',
+ 'tl_title', 'tl_namespace' ) );
$this->addWhere( $lb->constructSet( 'tl', $db ) );
$this->addWhere( 'pr_page = page_id' );
$this->addWhere( 'pr_page = tl_from' );
$this->resetQueryParams();
$this->addTables( array( 'page_restrictions', 'page', 'imagelinks' ) );
$this->addFields( array( 'pr_type', 'pr_level', 'pr_expiry',
- 'page_title', 'page_namespace', 'il_to' ) );
+ 'page_title', 'page_namespace', 'il_to' ) );
$this->addWhere( 'pr_page = page_id' );
$this->addWhere( 'pr_page = il_from' );
$this->addWhereFld( 'pr_cascade', 1 );
foreach ( $res as $row ) {
if ( MWNamespace::isTalk( $row->page_namespace ) ) {
$this->talkids[MWNamespace::getSubject( $row->page_namespace )][$row->page_title] =
- intval( $row->page_id );
+ intval( $row->page_id );
} else {
$this->subjectids[MWNamespace::getTalk( $row->page_namespace )][$row->page_title] =
- intval( $row->page_id );
+ intval( $row->page_id );
}
}
}
$this->watched[$row->wl_namespace][$row->wl_title] = true;
}
if ( $this->fld_notificationtimestamp ) {
- $this->notificationtimestamps[$row->wl_namespace][$row->wl_title] = $row->wl_notificationtimestamp;
+ $this->notificationtimestamps[$row->wl_namespace][$row->wl_title] =
+ $row->wl_notificationtimestamp;
}
}
}
if ( !is_null( $params['token'] ) ) {
return 'private';
}
+
return 'public';
}