MediaWiki REL1_37
|
Service for normalizing a page name using a MediaWiki api. More...
Public Member Functions | |
__construct (Http $http=null) | |
normalizePageName ( $pageName, $apiUrl, $followRedirect=self::FOLLOW_REDIRECT) | |
Returns the normalized form of the given page title, using the normalization rules of the given site. | |
Public Attributes | |
const | FOLLOW_REDIRECT = 1 |
const | NOFOLLOW_REDIRECT = 2 |
Static Private Member Functions | |
static | extractPageRecord ( $externalData, $pageTitle) |
Get normalization record for a given page title from an API response. | |
Private Attributes | |
Http | $http |
Service for normalizing a page name using a MediaWiki api.
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
Definition at line 36 of file MediaWikiPageNameNormalizer.php.
MediaWiki\Site\MediaWikiPageNameNormalizer::__construct | ( | Http | $http = null | ) |
Http | null | $http |
Definition at line 49 of file MediaWikiPageNameNormalizer.php.
References MediaWiki\Site\MediaWikiPageNameNormalizer\$http.
|
staticprivate |
Get normalization record for a given page title from an API response.
array | $externalData | A reply from the API on a external server. |
string | $pageTitle | Identifies the page at the external site, needing normalization. |
Definition at line 166 of file MediaWikiPageNameNormalizer.php.
MediaWiki\Site\MediaWikiPageNameNormalizer::normalizePageName | ( | $pageName, | |
$apiUrl, | |||
$followRedirect = self::FOLLOW_REDIRECT |
|||
) |
Returns the normalized form of the given page title, using the normalization rules of the given site.
If $followRedirect is set to self::FOLLOW_REDIRECT (default) and the given title is a redirect, the redirect will be resolved and the redirect target is returned. Only titles of existing pages will be returned.
string | $pageName | |
string | $apiUrl | |
int | $followRedirect | either self::FOLLOW_REDIRECT or self::NOFOLLOW_REDIRECT |
\MWException
InvalidArgumentException |
Definition at line 82 of file MediaWikiPageNameNormalizer.php.
References $args, wfAppendQuery(), and wfDebugLog().
|
private |
Definition at line 44 of file MediaWikiPageNameNormalizer.php.
Referenced by MediaWiki\Site\MediaWikiPageNameNormalizer\__construct().
const MediaWiki\Site\MediaWikiPageNameNormalizer::FOLLOW_REDIRECT = 1 |
Definition at line 38 of file MediaWikiPageNameNormalizer.php.
const MediaWiki\Site\MediaWikiPageNameNormalizer::NOFOLLOW_REDIRECT = 2 |
Definition at line 39 of file MediaWikiPageNameNormalizer.php.