MediaWiki
master
|
Handles the backend logic of moving a page from one title to another. More...
Public Member Functions | |
__construct (Title $oldTitle, Title $newTitle, ServiceOptions $options, ILoadBalancer $loadBalancer, NamespaceInfo $nsInfo, WatchedItemStoreInterface $watchedItems, RepoGroup $repoGroup, IContentHandlerFactory $contentHandlerFactory, RevisionStore $revisionStore, SpamChecker $spamChecker, HookContainer $hookContainer, WikiPageFactory $wikiPageFactory, UserFactory $userFactory, UserEditTracker $userEditTracker, MovePageFactory $movePageFactory, CollationFactory $collationFactory, PageUpdaterFactory $pageUpdaterFactory, RestrictionStore $restrictionStore) | |
authorizeMove (Authority $performer, string $reason=null) | |
Authorize the move by $performer. More... | |
checkPermissions (Authority $performer, $reason) | |
Check if the user is allowed to perform the move. More... | |
isValidMove () | |
Does various checks that the move is valid. More... | |
move (UserIdentity $user, $reason=null, $createRedirect=true, array $changeTags=[]) | |
Move a page without taking user permissions into account. More... | |
moveIfAllowed (Authority $performer, $reason=null, $createRedirect=true, array $changeTags=[]) | |
Same as move(), but with permissions checks. More... | |
moveSubpages (UserIdentity $user, $reason=null, $createRedirect=true, array $changeTags=[]) | |
Move the source page's subpages to be subpages of the target page, without checking user permissions. More... | |
moveSubpagesIfAllowed (Authority $performer, $reason=null, $createRedirect=true, array $changeTags=[]) | |
Move the source page's subpages to be subpages of the target page, with user permission checks. More... | |
probablyCanMove (Authority $performer, string $reason=null) | |
Check whether $performer can execute the move. More... | |
Public Attributes | |
CollationFactory | $collationFactory |
const | CONSTRUCTOR_OPTIONS |
Protected Member Functions | |
isValidFileMove () | |
Checks for when a file is being moved. More... | |
isValidMoveTarget () | |
Checks if $this can be moved to a given Title. More... | |
Protected Attributes | |
ILoadBalancer | $loadBalancer |
Title | $newTitle |
NamespaceInfo | $nsInfo |
Title | $oldTitle |
ServiceOptions | $options |
RepoGroup | $repoGroup |
WatchedItemStoreInterface | $watchedItems |
Private Member Functions | |
authorizeInternal (callable $authorizer, Authority $performer, ?string $reason) | |
moveFile ( $oldTitle, $newTitle) | |
Move a file associated with a page to a new location. More... | |
moveSubpagesInternal (callable $subpageMoveCallback) | |
moveToInternal (UserIdentity $user, &$nt, $reason='', $createRedirect=true, array $changeTags=[]) | |
Move page to a title which is either a redirect to the source page or nonexistent. More... | |
moveUnsafe (UserIdentity $user, $reason, $createRedirect, array $changeTags) | |
Moves without any sort of safety or other checks. More... | |
Handles the backend logic of moving a page from one title to another.
Definition at line 50 of file MovePage.php.
MovePage::__construct | ( | Title | $oldTitle, |
Title | $newTitle, | ||
ServiceOptions | $options, | ||
ILoadBalancer | $loadBalancer, | ||
NamespaceInfo | $nsInfo, | ||
WatchedItemStoreInterface | $watchedItems, | ||
RepoGroup | $repoGroup, | ||
IContentHandlerFactory | $contentHandlerFactory, | ||
RevisionStore | $revisionStore, | ||
SpamChecker | $spamChecker, | ||
HookContainer | $hookContainer, | ||
WikiPageFactory | $wikiPageFactory, | ||
UserFactory | $userFactory, | ||
UserEditTracker | $userEditTracker, | ||
MovePageFactory | $movePageFactory, | ||
CollationFactory | $collationFactory, | ||
PageUpdaterFactory | $pageUpdaterFactory, | ||
RestrictionStore | $restrictionStore | ||
) |
Title | $oldTitle | |
Title | $newTitle | |
ServiceOptions | $options | |
ILoadBalancer | $loadBalancer | |
NamespaceInfo | $nsInfo | |
WatchedItemStoreInterface | $watchedItems | |
RepoGroup | $repoGroup | |
IContentHandlerFactory | $contentHandlerFactory | |
RevisionStore | $revisionStore | |
SpamChecker | $spamChecker | |
HookContainer | $hookContainer | |
WikiPageFactory | $wikiPageFactory | |
UserFactory | $userFactory | |
UserEditTracker | $userEditTracker | |
MovePageFactory | $movePageFactory | |
CollationFactory | $collationFactory | |
PageUpdaterFactory | $pageUpdaterFactory | |
RestrictionStore | $restrictionStore |
Definition at line 162 of file MovePage.php.
References $collationFactory, $contentHandlerFactory, $loadBalancer, $movePageFactory, $newTitle, $nsInfo, $oldTitle, $options, $pageUpdaterFactory, $repoGroup, $restrictionStore, $revisionStore, $spamChecker, $userEditTracker, $userFactory, $watchedItems, and $wikiPageFactory.
|
private |
callable | $authorizer | ( string $action, PageIdentity $target, PermissionStatus $status ) |
Authority | $performer | |
string | null | $reason |
Definition at line 209 of file MovePage.php.
MovePage::authorizeMove | ( | Authority | $performer, |
string | $reason = null |
||
) |
Authorize the move by $performer.
Authority | $performer | |
string | null | $reason |
Definition at line 276 of file MovePage.php.
References MediaWiki\Permissions\Authority\authorizeWrite().
MovePage::checkPermissions | ( | Authority | $performer, |
$reason | |||
) |
Check if the user is allowed to perform the move.
Authority | $performer | |
string | null | $reason | To check against summary spam regex. Set to null to skip the check, for instance to display errors preemptively before the user has filled in a summary. |
Definition at line 295 of file MovePage.php.
References MediaWiki\Permissions\Authority\definitelyCan(), and Status\wrap().
|
protected |
Checks for when a file is being moved.
Definition at line 393 of file MovePage.php.
References $file, File\checkExtensionCompatibility(), NS_FILE, and wfStripIllegalFilenameChars().
MovePage::isValidMove | ( | ) |
Does various checks that the move is valid.
Only things based on the two titles should be checked here.
Definition at line 313 of file MovePage.php.
References ContentHandler\getLocalizedName(), NS_FILE, and wfMessage().
|
protected |
MovePage::move | ( | UserIdentity | $user, |
$reason = null , |
|||
$createRedirect = true , |
|||
array | $changeTags = [] |
||
) |
Move a page without taking user permissions into account.
Only checks if the move is itself invalid, e.g., trying to move a special page or trying to move a page onto one that already exists.
UserIdentity | $user | |
string | null | $reason | |
bool | null | $createRedirect | |
string[] | $changeTags | Change tags to apply to the entry in the move log |
Definition at line 478 of file MovePage.php.
|
private |
Move a file associated with a page to a new location.
Can also be used to revert after a DB failure.
Title | $oldTitle | Old location to move the file from. |
Title | $newTitle | New location to move the file to. |
Definition at line 797 of file MovePage.php.
References $file, and StatusValue\newGood().
MovePage::moveIfAllowed | ( | Authority | $performer, |
$reason = null , |
|||
$createRedirect = true , |
|||
array | $changeTags = [] |
||
) |
Same as move(), but with permissions checks.
Authority | $performer | |
string | null | $reason | |
bool | $createRedirect | Ignored if user doesn't have suppressredirect permission |
string[] | $changeTags | Change tags to apply to the entry in the move log |
Definition at line 498 of file MovePage.php.
References ChangeTags\canAddTagsAccompanyingChange(), MediaWiki\Permissions\Authority\getUser(), and MediaWiki\Permissions\Authority\isAllowed().
MovePage::moveSubpages | ( | UserIdentity | $user, |
$reason = null , |
|||
$createRedirect = true , |
|||
array | $changeTags = [] |
||
) |
Move the source page's subpages to be subpages of the target page, without checking user permissions.
The caller is responsible for moving the source page itself. We will still not do moves that are inherently not allowed, nor will we move more than $wgMaximumMovedPages.
UserIdentity | $user | |
string | null | $reason | The reason for the move |
bool | null | $createRedirect | Whether to create redirects from the old subpages to the new ones |
string[] | $changeTags | Applied to entries in the move log and redirect page revision |
Definition at line 537 of file MovePage.php.
MovePage::moveSubpagesIfAllowed | ( | Authority | $performer, |
$reason = null , |
|||
$createRedirect = true , |
|||
array | $changeTags = [] |
||
) |
Move the source page's subpages to be subpages of the target page, with user permission checks.
The caller is responsible for moving the source page itself.
Authority | $performer | |
string | null | $reason | The reason for the move |
bool | null | $createRedirect | Whether to create redirects from the old subpages to the new ones. Ignored if the user doesn't have the 'suppressredirect' right. |
string[] | $changeTags | Applied to entries in the move log and redirect page revision |
Definition at line 562 of file MovePage.php.
References MediaWiki\Permissions\Authority\authorizeWrite(), and StatusValue\newFatal().
|
private |
callable | $subpageMoveCallback |
MWException |
Definition at line 582 of file MovePage.php.
References StringUtils\escapeRegexReplacement(), Title\makeTitleSafe(), StatusValue\newFatal(), and StatusValue\newGood().
|
private |
Move page to a title which is either a redirect to the source page or nonexistent.
UserIdentity | $user | doing the move |
Title | &$nt | The page to move to, which should be a redirect or non-existent |
string | $reason | The reason for the move |
bool | $createRedirect | Whether to leave a redirect at the old title. Does not check if the user has the suppressredirect right |
string[] | $changeTags | Change tags to apply to the entry in the move log |
Definition at line 830 of file MovePage.php.
|
private |
Moves without any sort of safety or other checks.
Hooks can still fail the move, however.
UserIdentity | $user | |
string | $reason | |
bool | $createRedirect | |
string[] | $changeTags | Change tags to apply to the entry in the move log |
Definition at line 653 of file MovePage.php.
References $res, DeferredUpdates\addUpdate(), DB_PRIMARY, StatusValue\newGood(), NS_FILE, and wfMessage().
MovePage::probablyCanMove | ( | Authority | $performer, |
string | $reason = null |
||
) |
Check whether $performer can execute the move.
Authority | $performer | |
string | null | $reason |
Definition at line 255 of file MovePage.php.
References MediaWiki\Permissions\Authority\probablyCan().
CollationFactory MovePage::$collationFactory |
Definition at line 124 of file MovePage.php.
Referenced by __construct().
|
private |
Definition at line 90 of file MovePage.php.
Referenced by __construct().
|
private |
Definition at line 105 of file MovePage.php.
|
protected |
Definition at line 70 of file MovePage.php.
Referenced by __construct().
|
private |
Definition at line 121 of file MovePage.php.
Referenced by __construct().
|
protected |
Definition at line 60 of file MovePage.php.
Referenced by __construct().
|
protected |
Definition at line 75 of file MovePage.php.
Referenced by __construct().
|
protected |
Definition at line 55 of file MovePage.php.
Referenced by __construct().
|
protected |
Definition at line 65 of file MovePage.php.
Referenced by __construct().
|
private |
Definition at line 127 of file MovePage.php.
Referenced by __construct().
|
protected |
Definition at line 85 of file MovePage.php.
Referenced by __construct().
|
private |
Definition at line 130 of file MovePage.php.
Referenced by __construct().
|
private |
Definition at line 95 of file MovePage.php.
Referenced by __construct().
|
private |
Definition at line 100 of file MovePage.php.
Referenced by __construct().
|
private |
Definition at line 118 of file MovePage.php.
Referenced by __construct().
|
private |
Definition at line 115 of file MovePage.php.
Referenced by __construct().
|
protected |
Definition at line 80 of file MovePage.php.
Referenced by __construct().
|
private |
Definition at line 110 of file MovePage.php.
Referenced by __construct().
const MovePage::CONSTRUCTOR_OPTIONS |
Definition at line 135 of file MovePage.php.