2012-06-18 20:33:19 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* API for MediaWiki 1.14+
|
|
|
|
|
*
|
2017-06-13 16:51:53 +00:00
|
|
|
* Copyright © 2012 Wikimedia Foundation and contributors
|
2012-06-18 20:33:19 +00:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
|
|
|
|
* @file
|
|
|
|
|
*/
|
2018-02-16 18:23:45 +00:00
|
|
|
|
2020-10-21 15:05:02 +00:00
|
|
|
use MediaWiki\Revision\RevisionStore;
|
|
|
|
|
use Wikimedia\Rdbms\ILoadBalancer;
|
2012-06-18 20:33:19 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* API interface for setting the wl_notificationtimestamp field
|
|
|
|
|
* @ingroup API
|
|
|
|
|
*/
|
|
|
|
|
class ApiSetNotificationTimestamp extends ApiBase {
|
|
|
|
|
|
2018-04-05 10:39:24 +00:00
|
|
|
private $mPageSet = null;
|
2013-02-08 20:39:40 +00:00
|
|
|
|
2020-10-21 15:05:02 +00:00
|
|
|
/** @var RevisionStore */
|
|
|
|
|
private $revisionStore;
|
|
|
|
|
|
|
|
|
|
/** @var ILoadBalancer */
|
|
|
|
|
private $loadBalancer;
|
|
|
|
|
|
|
|
|
|
/** @var WatchedItemStoreInterface */
|
|
|
|
|
private $watchedItemStore;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param ApiMain $main
|
|
|
|
|
* @param string $action
|
|
|
|
|
* @param ILoadBalancer $loadBalancer
|
|
|
|
|
* @param RevisionStore $revisionStore
|
|
|
|
|
* @param WatchedItemStoreInterface $watchedItemStore
|
|
|
|
|
*/
|
|
|
|
|
public function __construct(
|
|
|
|
|
ApiMain $main,
|
|
|
|
|
$action,
|
|
|
|
|
ILoadBalancer $loadBalancer,
|
|
|
|
|
RevisionStore $revisionStore,
|
|
|
|
|
WatchedItemStoreInterface $watchedItemStore
|
|
|
|
|
) {
|
|
|
|
|
parent::__construct( $main, $action );
|
|
|
|
|
|
|
|
|
|
$this->loadBalancer = $loadBalancer;
|
|
|
|
|
$this->revisionStore = $revisionStore;
|
|
|
|
|
$this->watchedItemStore = $watchedItemStore;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-18 20:33:19 +00:00
|
|
|
public function execute() {
|
|
|
|
|
$user = $this->getUser();
|
|
|
|
|
|
2021-06-28 19:04:55 +00:00
|
|
|
if ( !$user->isRegistered() ) {
|
2016-10-19 16:54:25 +00:00
|
|
|
$this->dieWithError( 'watchlistanontext', 'notloggedin' );
|
2013-06-13 18:02:55 +00:00
|
|
|
}
|
2016-10-19 16:54:25 +00:00
|
|
|
$this->checkUserRightsAny( 'editmywatchlist' );
|
2012-06-18 20:33:19 +00:00
|
|
|
|
|
|
|
|
$params = $this->extractRequestParams();
|
|
|
|
|
$this->requireMaxOneParameter( $params, 'timestamp', 'torevid', 'newerthanrevid' );
|
|
|
|
|
|
2016-02-17 09:09:32 +00:00
|
|
|
$continuationManager = new ApiContinuationManager( $this, [], [] );
|
API: Overhaul ApiResult, make format=xml not throw, and add json formatversion
ApiResult was a mess: some methods could only be used with an array
reference instead of manipulating the stored data, methods that had both
array-ref and internal-data versions had names that didn't at all
correspond, some methods that worked on an array reference were
annoyingly non-static, and then the whole mess with setIndexedTagName.
ApiFormatXml is also entirely annoying to deal with, as it liked to
throw exceptions if certain metadata wasn't provided that no other
formatter required. Its legacy also means we have this silly convention
of using empty-string rather than boolean true, annoying restrictions on
keys (leading to things that should be hashes being arrays of key-value
object instead), '*' used as a key all over the place, and so on.
So, changes here:
* ApiResult is no longer an ApiBase or a ContextSource.
* Wherever sensible, ApiResult provides a static method working on an
arrayref and a non-static method working on internal data.
* Metadata is now always added to ApiResult's internal data structure.
Formatters are responsible for stripping it if necessary. "raw mode"
is deprecated.
* New metadata to replace the '*' key, solve the array() => '[]' vs '{}'
question, and so on.
* New class for formatting warnings and errors using i18n messages, and
support for multiple errors and a more machine-readable format for
warnings. For the moment, though, the actual output will not be changing
yet (see T47843 for future plans).
* New formatversion parameter for format=json and format=php, to select
between BC mode and the modern output.
* In BC mode, booleans will be converted to empty-string presence style;
modules currently returning booleans will need to use
ApiResult::META_BC_BOOLS to preserve their current output.
Actual changes to the API modules' output (e.g. actually returning
booleans for the new formatversion) beyond the use of
ApiResult::setContentValue() are left for a future change.
Bug: T76728
Bug: T57371
Bug: T33629
Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678f
2014-12-03 22:14:22 +00:00
|
|
|
$this->setContinuationManager( $continuationManager );
|
2014-02-07 01:52:58 +00:00
|
|
|
|
2013-02-08 20:39:40 +00:00
|
|
|
$pageSet = $this->getPageSet();
|
2013-03-15 18:03:19 +00:00
|
|
|
if ( $params['entirewatchlist'] && $pageSet->getDataSource() !== null ) {
|
2016-10-19 16:54:25 +00:00
|
|
|
$this->dieWithError(
|
|
|
|
|
[
|
|
|
|
|
'apierror-invalidparammix-cannotusewith',
|
|
|
|
|
$this->encodeParamName( 'entirewatchlist' ),
|
|
|
|
|
$pageSet->encodeParamName( $pageSet->getDataSource() )
|
|
|
|
|
],
|
2013-11-14 13:31:56 +00:00
|
|
|
'multisource'
|
|
|
|
|
);
|
2013-03-15 18:03:19 +00:00
|
|
|
}
|
2012-06-18 20:33:19 +00:00
|
|
|
|
2021-04-29 02:37:11 +00:00
|
|
|
$dbw = $this->loadBalancer->getConnectionRef( DB_PRIMARY, 'api' );
|
2012-06-18 20:33:19 +00:00
|
|
|
|
|
|
|
|
$timestamp = null;
|
|
|
|
|
if ( isset( $params['timestamp'] ) ) {
|
|
|
|
|
$timestamp = $dbw->timestamp( $params['timestamp'] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( !$params['entirewatchlist'] ) {
|
|
|
|
|
$pageSet->execute();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( isset( $params['torevid'] ) ) {
|
|
|
|
|
if ( $params['entirewatchlist'] || $pageSet->getGoodTitleCount() > 1 ) {
|
2016-10-19 16:54:25 +00:00
|
|
|
$this->dieWithError( [ 'apierror-multpages', $this->encodeParamName( 'torevid' ) ] );
|
2012-06-18 20:33:19 +00:00
|
|
|
}
|
2018-02-16 18:23:45 +00:00
|
|
|
$titles = $pageSet->getGoodTitles();
|
|
|
|
|
$title = reset( $titles );
|
2013-05-04 12:34:41 +00:00
|
|
|
if ( $title ) {
|
Don't require Title for getTimestampFromId
3e36ba655e3a added an option for passing a page ID to this method of
Revision, and e03787afd91c switched it to a Title and made it mandatory.
This behavior propagated to the method in RevisionStore. As far as I
can tell, the parameter does not help anything, but it can add a
database query to get the page ID if it's not cached, and impedes
conversion to LinkTarget. I can't figure out any reason to not
completely drop it. I've noted it as deprecated but still supported it
for now for compatibility -- I found one extension that does pass it.
(It's ignored, though, which theoretically would be a behavior change if
someone was passing a Title that didn't match the revision ID.)
While I was at it, I added the method to RevisionLookup, although it's
only used in later patches. Properly I should move that piece to a later
patch, but it didn't seem worth the effort.
I didn't change the Revision method, because the whole Revision class is
deprecated anyway.
Change-Id: I26ef5f2bf828f0f450633b7237d26d888e2c8773
2019-04-29 14:32:22 +00:00
|
|
|
// XXX $title isn't actually used, can we just get rid of the previous six lines?
|
2020-10-21 15:05:02 +00:00
|
|
|
$timestamp = $this->revisionStore->getTimestampFromId(
|
|
|
|
|
$params['torevid'],
|
|
|
|
|
IDBAccessObject::READ_LATEST
|
|
|
|
|
);
|
2013-05-04 12:34:41 +00:00
|
|
|
if ( $timestamp ) {
|
|
|
|
|
$timestamp = $dbw->timestamp( $timestamp );
|
|
|
|
|
} else {
|
|
|
|
|
$timestamp = null;
|
|
|
|
|
}
|
2012-06-18 20:33:19 +00:00
|
|
|
}
|
|
|
|
|
} elseif ( isset( $params['newerthanrevid'] ) ) {
|
|
|
|
|
if ( $params['entirewatchlist'] || $pageSet->getGoodTitleCount() > 1 ) {
|
2016-10-19 16:54:25 +00:00
|
|
|
$this->dieWithError( [ 'apierror-multpages', $this->encodeParamName( 'newerthanrevid' ) ] );
|
2012-06-18 20:33:19 +00:00
|
|
|
}
|
2018-02-16 18:23:45 +00:00
|
|
|
$titles = $pageSet->getGoodTitles();
|
|
|
|
|
$title = reset( $titles );
|
2013-05-04 12:34:41 +00:00
|
|
|
if ( $title ) {
|
2019-08-27 02:45:33 +00:00
|
|
|
$timestamp = null;
|
2020-10-21 15:05:02 +00:00
|
|
|
$currRev = $this->revisionStore->getRevisionById(
|
|
|
|
|
$params['newerthanrevid'],
|
|
|
|
|
Title::READ_LATEST
|
|
|
|
|
);
|
2019-08-27 02:45:33 +00:00
|
|
|
if ( $currRev ) {
|
2020-10-21 15:05:02 +00:00
|
|
|
$nextRev = $this->revisionStore->getNextRevision(
|
|
|
|
|
$currRev,
|
|
|
|
|
Title::READ_LATEST
|
|
|
|
|
);
|
2019-08-27 02:45:33 +00:00
|
|
|
if ( $nextRev ) {
|
|
|
|
|
$timestamp = $dbw->timestamp( $nextRev->getTimestamp() );
|
|
|
|
|
}
|
2013-05-04 12:34:41 +00:00
|
|
|
}
|
2012-06-18 20:33:19 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$apiResult = $this->getResult();
|
2016-02-17 09:09:32 +00:00
|
|
|
$result = [];
|
2012-06-18 20:33:19 +00:00
|
|
|
if ( $params['entirewatchlist'] ) {
|
|
|
|
|
// Entire watchlist mode: Just update the thing and return a success indicator
|
2020-10-21 15:05:02 +00:00
|
|
|
$this->watchedItemStore->resetAllNotificationTimestampsForUser( $user, $timestamp );
|
2012-06-18 20:33:19 +00:00
|
|
|
|
2020-01-09 23:48:34 +00:00
|
|
|
$result['notificationtimestamp'] = $timestamp === null
|
2013-11-14 13:31:56 +00:00
|
|
|
? ''
|
|
|
|
|
: wfTimestamp( TS_ISO_8601, $timestamp );
|
2012-06-18 20:33:19 +00:00
|
|
|
} else {
|
|
|
|
|
// First, log the invalid titles
|
2015-05-06 19:33:37 +00:00
|
|
|
foreach ( $pageSet->getInvalidTitlesAndReasons() as $r ) {
|
2015-01-16 19:00:07 +00:00
|
|
|
$r['invalid'] = true;
|
2012-06-18 20:33:19 +00:00
|
|
|
$result[] = $r;
|
|
|
|
|
}
|
2013-02-08 20:39:40 +00:00
|
|
|
foreach ( $pageSet->getMissingPageIDs() as $p ) {
|
2016-02-17 09:09:32 +00:00
|
|
|
$page = [];
|
2012-06-18 20:33:19 +00:00
|
|
|
$page['pageid'] = $p;
|
2015-01-16 19:00:07 +00:00
|
|
|
$page['missing'] = true;
|
|
|
|
|
$page['notwatched'] = true;
|
2012-06-18 20:33:19 +00:00
|
|
|
$result[] = $page;
|
|
|
|
|
}
|
2013-02-08 20:39:40 +00:00
|
|
|
foreach ( $pageSet->getMissingRevisionIDs() as $r ) {
|
2016-02-17 09:09:32 +00:00
|
|
|
$rev = [];
|
2012-06-18 20:33:19 +00:00
|
|
|
$rev['revid'] = $r;
|
2015-01-16 19:00:07 +00:00
|
|
|
$rev['missing'] = true;
|
|
|
|
|
$rev['notwatched'] = true;
|
2012-06-18 20:33:19 +00:00
|
|
|
$result[] = $rev;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-30 14:41:54 +00:00
|
|
|
if ( $pageSet->getPages() ) {
|
2013-05-04 12:34:41 +00:00
|
|
|
// Now process the valid titles
|
2020-10-21 15:05:02 +00:00
|
|
|
$this->watchedItemStore->setNotificationTimestampsForUser(
|
2016-05-04 15:49:27 +00:00
|
|
|
$user,
|
|
|
|
|
$timestamp,
|
2021-04-30 14:41:54 +00:00
|
|
|
$pageSet->getPages()
|
2013-05-04 12:34:41 +00:00
|
|
|
);
|
2012-06-18 20:33:19 +00:00
|
|
|
|
2013-05-04 12:34:41 +00:00
|
|
|
// Query the results of our update
|
2020-10-21 15:05:02 +00:00
|
|
|
$timestamps = $this->watchedItemStore->getNotificationTimestampsBatch(
|
2016-05-06 09:25:37 +00:00
|
|
|
$user,
|
2021-04-30 14:41:54 +00:00
|
|
|
$pageSet->getPages()
|
2012-06-18 20:33:19 +00:00
|
|
|
);
|
2013-05-04 12:34:41 +00:00
|
|
|
|
|
|
|
|
// Now, put the valid titles into the result
|
2017-09-04 18:05:26 +00:00
|
|
|
/** @var Title $title */
|
2013-05-04 12:34:41 +00:00
|
|
|
foreach ( $pageSet->getTitles() as $title ) {
|
|
|
|
|
$ns = $title->getNamespace();
|
|
|
|
|
$dbkey = $title->getDBkey();
|
2016-02-17 09:09:32 +00:00
|
|
|
$r = [
|
2021-01-05 22:13:25 +00:00
|
|
|
'ns' => $ns,
|
2013-05-04 12:34:41 +00:00
|
|
|
'title' => $title->getPrefixedText(),
|
2016-02-17 09:09:32 +00:00
|
|
|
];
|
2013-05-04 12:34:41 +00:00
|
|
|
if ( !$title->exists() ) {
|
2015-01-16 19:00:07 +00:00
|
|
|
$r['missing'] = true;
|
2016-08-15 18:27:40 +00:00
|
|
|
if ( $title->isKnown() ) {
|
|
|
|
|
$r['known'] = true;
|
|
|
|
|
}
|
2012-06-18 20:33:19 +00:00
|
|
|
}
|
2013-05-04 12:34:41 +00:00
|
|
|
if ( isset( $timestamps[$ns] ) && array_key_exists( $dbkey, $timestamps[$ns] ) ) {
|
|
|
|
|
$r['notificationtimestamp'] = '';
|
|
|
|
|
if ( $timestamps[$ns][$dbkey] !== null ) {
|
|
|
|
|
$r['notificationtimestamp'] = wfTimestamp( TS_ISO_8601, $timestamps[$ns][$dbkey] );
|
|
|
|
|
}
|
|
|
|
|
} else {
|
2015-01-16 19:00:07 +00:00
|
|
|
$r['notwatched'] = true;
|
2013-05-04 12:34:41 +00:00
|
|
|
}
|
|
|
|
|
$result[] = $r;
|
2012-06-18 20:33:19 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
API: Overhaul ApiResult, make format=xml not throw, and add json formatversion
ApiResult was a mess: some methods could only be used with an array
reference instead of manipulating the stored data, methods that had both
array-ref and internal-data versions had names that didn't at all
correspond, some methods that worked on an array reference were
annoyingly non-static, and then the whole mess with setIndexedTagName.
ApiFormatXml is also entirely annoying to deal with, as it liked to
throw exceptions if certain metadata wasn't provided that no other
formatter required. Its legacy also means we have this silly convention
of using empty-string rather than boolean true, annoying restrictions on
keys (leading to things that should be hashes being arrays of key-value
object instead), '*' used as a key all over the place, and so on.
So, changes here:
* ApiResult is no longer an ApiBase or a ContextSource.
* Wherever sensible, ApiResult provides a static method working on an
arrayref and a non-static method working on internal data.
* Metadata is now always added to ApiResult's internal data structure.
Formatters are responsible for stripping it if necessary. "raw mode"
is deprecated.
* New metadata to replace the '*' key, solve the array() => '[]' vs '{}'
question, and so on.
* New class for formatting warnings and errors using i18n messages, and
support for multiple errors and a more machine-readable format for
warnings. For the moment, though, the actual output will not be changing
yet (see T47843 for future plans).
* New formatversion parameter for format=json and format=php, to select
between BC mode and the modern output.
* In BC mode, booleans will be converted to empty-string presence style;
modules currently returning booleans will need to use
ApiResult::META_BC_BOOLS to preserve their current output.
Actual changes to the API modules' output (e.g. actually returning
booleans for the new formatversion) beyond the use of
ApiResult::setContentValue() are left for a future change.
Bug: T76728
Bug: T57371
Bug: T33629
Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678f
2014-12-03 22:14:22 +00:00
|
|
|
ApiResult::setIndexedTagName( $result, 'page' );
|
2012-06-18 20:33:19 +00:00
|
|
|
}
|
|
|
|
|
$apiResult->addValue( null, $this->getModuleName(), $result );
|
2014-02-07 01:52:58 +00:00
|
|
|
|
API: Overhaul ApiResult, make format=xml not throw, and add json formatversion
ApiResult was a mess: some methods could only be used with an array
reference instead of manipulating the stored data, methods that had both
array-ref and internal-data versions had names that didn't at all
correspond, some methods that worked on an array reference were
annoyingly non-static, and then the whole mess with setIndexedTagName.
ApiFormatXml is also entirely annoying to deal with, as it liked to
throw exceptions if certain metadata wasn't provided that no other
formatter required. Its legacy also means we have this silly convention
of using empty-string rather than boolean true, annoying restrictions on
keys (leading to things that should be hashes being arrays of key-value
object instead), '*' used as a key all over the place, and so on.
So, changes here:
* ApiResult is no longer an ApiBase or a ContextSource.
* Wherever sensible, ApiResult provides a static method working on an
arrayref and a non-static method working on internal data.
* Metadata is now always added to ApiResult's internal data structure.
Formatters are responsible for stripping it if necessary. "raw mode"
is deprecated.
* New metadata to replace the '*' key, solve the array() => '[]' vs '{}'
question, and so on.
* New class for formatting warnings and errors using i18n messages, and
support for multiple errors and a more machine-readable format for
warnings. For the moment, though, the actual output will not be changing
yet (see T47843 for future plans).
* New formatversion parameter for format=json and format=php, to select
between BC mode and the modern output.
* In BC mode, booleans will be converted to empty-string presence style;
modules currently returning booleans will need to use
ApiResult::META_BC_BOOLS to preserve their current output.
Actual changes to the API modules' output (e.g. actually returning
booleans for the new formatversion) beyond the use of
ApiResult::setContentValue() are left for a future change.
Bug: T76728
Bug: T57371
Bug: T33629
Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678f
2014-12-03 22:14:22 +00:00
|
|
|
$this->setContinuationManager( null );
|
|
|
|
|
$continuationManager->setContinuationIntoResult( $apiResult );
|
2012-06-18 20:33:19 +00:00
|
|
|
}
|
|
|
|
|
|
2013-02-08 20:39:40 +00:00
|
|
|
/**
|
|
|
|
|
* Get a cached instance of an ApiPageSet object
|
|
|
|
|
* @return ApiPageSet
|
|
|
|
|
*/
|
|
|
|
|
private function getPageSet() {
|
2018-04-05 10:39:24 +00:00
|
|
|
if ( $this->mPageSet === null ) {
|
2013-02-08 20:39:40 +00:00
|
|
|
$this->mPageSet = new ApiPageSet( $this );
|
|
|
|
|
}
|
2013-11-14 13:01:41 +00:00
|
|
|
|
2013-02-08 20:39:40 +00:00
|
|
|
return $this->mPageSet;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-18 20:33:19 +00:00
|
|
|
public function mustBePosted() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function isWriteMode() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function needsToken() {
|
2014-08-08 16:56:07 +00:00
|
|
|
return 'csrf';
|
2012-06-18 20:33:19 +00:00
|
|
|
}
|
|
|
|
|
|
2013-02-08 20:39:40 +00:00
|
|
|
public function getAllowedParams( $flags = 0 ) {
|
2016-02-17 09:09:32 +00:00
|
|
|
$result = [
|
|
|
|
|
'entirewatchlist' => [
|
2012-06-18 20:33:19 +00:00
|
|
|
ApiBase::PARAM_TYPE => 'boolean'
|
2016-02-17 09:09:32 +00:00
|
|
|
],
|
|
|
|
|
'timestamp' => [
|
2012-06-18 20:33:19 +00:00
|
|
|
ApiBase::PARAM_TYPE => 'timestamp'
|
2016-02-17 09:09:32 +00:00
|
|
|
],
|
|
|
|
|
'torevid' => [
|
2012-06-18 20:33:19 +00:00
|
|
|
ApiBase::PARAM_TYPE => 'integer'
|
2016-02-17 09:09:32 +00:00
|
|
|
],
|
|
|
|
|
'newerthanrevid' => [
|
2012-06-18 20:33:19 +00:00
|
|
|
ApiBase::PARAM_TYPE => 'integer'
|
2016-02-17 09:09:32 +00:00
|
|
|
],
|
|
|
|
|
'continue' => [
|
2014-09-18 17:38:23 +00:00
|
|
|
ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
|
2016-02-17 09:09:32 +00:00
|
|
|
],
|
|
|
|
|
];
|
2013-02-08 20:39:40 +00:00
|
|
|
if ( $flags ) {
|
|
|
|
|
$result += $this->getPageSet()->getFinalParams( $flags );
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-14 13:01:41 +00:00
|
|
|
return $result;
|
2012-06-18 20:33:19 +00:00
|
|
|
}
|
|
|
|
|
|
2014-10-28 17:17:02 +00:00
|
|
|
protected function getExamplesMessages() {
|
2016-02-17 09:09:32 +00:00
|
|
|
return [
|
2014-09-18 17:38:23 +00:00
|
|
|
'action=setnotificationtimestamp&entirewatchlist=&token=123ABC'
|
|
|
|
|
=> 'apihelp-setnotificationtimestamp-example-all',
|
|
|
|
|
'action=setnotificationtimestamp&titles=Main_page&token=123ABC'
|
|
|
|
|
=> 'apihelp-setnotificationtimestamp-example-page',
|
|
|
|
|
'action=setnotificationtimestamp&titles=Main_page&' .
|
2013-11-14 13:31:56 +00:00
|
|
|
'timestamp=2012-01-01T00:00:00Z&token=123ABC'
|
2014-09-18 17:38:23 +00:00
|
|
|
=> 'apihelp-setnotificationtimestamp-example-pagetimestamp',
|
|
|
|
|
'action=setnotificationtimestamp&generator=allpages&gapnamespace=2&token=123ABC'
|
|
|
|
|
=> 'apihelp-setnotificationtimestamp-example-allpages',
|
2016-02-17 09:09:32 +00:00
|
|
|
];
|
2012-06-18 20:33:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getHelpUrls() {
|
2017-04-04 22:52:57 +00:00
|
|
|
return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:SetNotificationTimestamp';
|
2012-06-18 20:33:19 +00:00
|
|
|
}
|
|
|
|
|
}
|