Rename PHP class RandomPage to SpecialRandomPage

This change is for consistency to the file name and to other classes.

The old class name RandomPage is kept as alias for compatibility and is
now deprecated.

Also change the letter case in the class names and file names:
* SpecialRandompage     -> SpecialRandomPage
* SpecialRandomredirect -> SpecialRandomRedirect
* SpecialRandomrootpage -> SpecialRandomRootPage

The change of the letter case of file names may cause problems on
Windows operating systems.

Change-Id: If4dd23126e0d032f42a86aff7d09414edcb1ade2
This commit is contained in:
Fomafix 2020-01-13 17:24:36 +01:00 committed by James D. Forrester
parent 9abe4e6ab5
commit 12f9cba673
7 changed files with 34 additions and 10 deletions

View file

@ -73,7 +73,6 @@
-->
<exclude-pattern>*/includes/specials/SpecialMostimages\.php</exclude-pattern>
<exclude-pattern>*/includes/specials/SpecialMovepage\.php</exclude-pattern>
<exclude-pattern>*/includes/specials/SpecialRandompage\.php</exclude-pattern>
<exclude-pattern>*/includes/specials/SpecialUserrights\.php</exclude-pattern>
<exclude-pattern>*/includes/specials/SpecialWantedfiles\.php</exclude-pattern>
<exclude-pattern>*/includes/specials/SpecialWantedpages\.php</exclude-pattern>

View file

@ -623,6 +623,8 @@ because of Phabricator reports.
warnings.
* CentralIdLookup::factory and ::factoryNonLocal were hard-deprecated,
obtain an instance from MediaWikiServices instead.
* The class RandomPage was renamed to SpecialRandomPage. The class RandomPage
is now deprecated.
* BotPassword::invalidateAllPasswordsForCentralId() was deprecated.
* BotPassword::removeAllPasswordsForCentralId() was deprecated.
* The Title class members: $mTextform, $mUrlform, $mDbkeyform, $mNamespace,
@ -728,6 +730,22 @@ because of Phabricator reports.
renamed to 'mw-htmlform-autoinfuse'. (T278036)
* User::newFromRow does not accept pre-loaded user preferences under
$data['user_properties'] anymore. This optimization was not used.
* The following files were renamed to change the casing to title case:
- SpecialRandompage -> SpecialRandomPage
- SpecialRandomredirect -> SpecialRandomRedirect
- SpecialRandomrootpage -> SpecialRandomRootPage
* The following methods in MWNamespace, all deprecated since 1.34, now emit
deprecation warnings:
- isMovable()
- subjectEquals()
- hasTalkNamespace()
- wantSignatures()
- isWatchable()
- hasGenderDistinction()
- getRestrictionLevels()
- getCategoryLinkType()
* LogFormatter::styleRestricedElement has been deprecated in favor of
LogFormatter::styleRestrictedElement
* …
== Compatibility ==

View file

@ -1303,7 +1303,7 @@ $wgAutoloadLocalClasses = [
'RCFeedFormatter' => __DIR__ . '/includes/rcfeed/RCFeedFormatter.php',
'RESTBagOStuff' => __DIR__ . '/includes/libs/objectcache/RESTBagOStuff.php',
'RSSFeed' => __DIR__ . '/includes/changes/RSSFeed.php',
'RandomPage' => __DIR__ . '/includes/specials/SpecialRandompage.php',
'RandomPage' => __DIR__ . '/includes/specials/SpecialRandomPage.php',
'RangeChronologicalPager' => __DIR__ . '/includes/pager/RangeChronologicalPager.php',
'RangeDifference' => __DIR__ . '/includes/diff/RangeDifference.php',
'RawAction' => __DIR__ . '/includes/actions/RawAction.php',
@ -1553,8 +1553,9 @@ $wgAutoloadLocalClasses = [
'SpecialProtectedtitles' => __DIR__ . '/includes/specials/SpecialProtectedtitles.php',
'SpecialPurge' => __DIR__ . '/includes/specials/SpecialPurge.php',
'SpecialRandomInCategory' => __DIR__ . '/includes/specials/SpecialRandomInCategory.php',
'SpecialRandomredirect' => __DIR__ . '/includes/specials/SpecialRandomredirect.php',
'SpecialRandomrootpage' => __DIR__ . '/includes/specials/SpecialRandomrootpage.php',
'SpecialRandomPage' => __DIR__ . '/includes/specials/SpecialRandomPage.php',
'SpecialRandomRedirect' => __DIR__ . '/includes/specials/SpecialRandomRedirect.php',
'SpecialRandomRootPage' => __DIR__ . '/includes/specials/SpecialRandomRootPage.php',
'SpecialRecentChanges' => __DIR__ . '/includes/specials/SpecialRecentChanges.php',
'SpecialRecentChangesLinked' => __DIR__ . '/includes/specials/SpecialRecentChangesLinked.php',
'SpecialRedirect' => __DIR__ . '/includes/specials/SpecialRedirect.php',

View file

@ -657,7 +657,7 @@ class SpecialPageFactory {
]
],
'Randompage' => [
'class' => \RandomPage::class,
'class' => \SpecialRandomPage::class,
'services' => [
'DBLoadBalancer',
'NamespaceInfo',
@ -670,14 +670,14 @@ class SpecialPageFactory {
]
],
'Randomredirect' => [
'class' => \SpecialRandomredirect::class,
'class' => \SpecialRandomRedirect::class,
'services' => [
'DBLoadBalancer',
'NamespaceInfo',
]
],
'Randomrootpage' => [
'class' => \SpecialRandomrootpage::class,
'class' => \SpecialRandomRootPage::class,
'services' => [
'DBLoadBalancer',
'NamespaceInfo',

View file

@ -30,7 +30,7 @@ use Wikimedia\Rdbms\ILoadBalancer;
*
* @ingroup SpecialPage
*/
class RandomPage extends SpecialPage {
class SpecialRandomPage extends SpecialPage {
private $namespaces; // namespaces to select pages from
protected $isRedir = false; // should the result be a redirect?
protected $extra = []; // Extra SQL statements
@ -195,3 +195,9 @@ class RandomPage extends SpecialPage {
return 'redirects';
}
}
/**
* Retain the old class name for backwards compatibility.
* @deprecated since 1.37
*/
class_alias( SpecialRandomPage::class, 'RandomPage' );

View file

@ -29,7 +29,7 @@ use Wikimedia\Rdbms\ILoadBalancer;
*
* @ingroup SpecialPage
*/
class SpecialRandomredirect extends RandomPage {
class SpecialRandomRedirect extends SpecialRandomPage {
/**
* @param ILoadBalancer $loadBalancer

View file

@ -26,7 +26,7 @@ use Wikimedia\Rdbms\ILoadBalancer;
* @ingroup SpecialPage
*/
class SpecialRandomrootpage extends RandomPage {
class SpecialRandomRootPage extends SpecialRandomPage {
/**
* @param ILoadBalancer $loadBalancer