72 $this->newForCategorizationCallback = [ RecentChange::class,
'newForCategorization' ];
85 if ( !defined(
'MW_PHPUNIT_TEST' ) ) {
86 throw new MWException(
'Cannot override newForCategorization callback in operation.' );
88 $this->newForCategorizationCallback = $callback;
95 $this->numTemplateLinks = $this->pageTitle->getBacklinkCache()->getNumLinks(
'templatelinks' );
129 $this->pageTitle->getPrefixedText(),
130 $this->numTemplateLinks
133 $this->getPreviousRevisionTimestamp(),
135 $type === self::CATEGORY_ADDITION
153 Title $categoryTitle,
173 # If no revision is given, the change was probably triggered by parser functions
175 $correspondingRc = $this->revision->getRecentChange();
176 if ( $correspondingRc ===
null ) {
177 $correspondingRc = $this->revision->getRecentChange( Revision::READ_LATEST );
179 if ( $correspondingRc !==
null ) {
180 $bot = $correspondingRc->getAttribute(
'rc_bot' ) ?: 0;
181 $ip = $correspondingRc->getAttribute(
'rc_ip' ) ?:
'';
182 $lastRevId = $correspondingRc->getAttribute(
'rc_last_oldid' ) ?: 0;
216 if ( $this->revision ) {
218 if ( $userId === 0 ) {
227 # User::newFromName() can return false on a badly configured wiki.
228 if ( $user && !$user->isLoggedIn() ) {
229 $user->addToDatabase();
253 self::CATEGORY_ADDITION =>
'recentchanges-page-added-to-category',
254 self::CATEGORY_REMOVAL =>
'recentchanges-page-removed-from-category',
257 $msgKey = $array[
$type];
260 $msgKey .=
'-bundled';
263 return wfMessage( $msgKey, $prefixedText )->inContentLanguage()->text();
274 $this->pageTitle->getPreviousRevisionID( $this->pageTitle->getLatestRevID() )
277 return $previousRev ? $previousRev->getTimestamp() :
null;
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
getPreviousRevisionTimestamp()
Returns the timestamp of the page's previous revision or null if the latest revision does not refer t...
callable null $newForCategorizationCallback
getChangeMessageText( $type, $prefixedText, $numTemplateLinks)
Returns the change message according to the type of category membership change.
createRecentChangesEntry(Title $categoryTitle, $type)
Create a recentchanges entry using RecentChange::notifyCategorization()
__construct(Title $pageTitle, Revision $revision=null)
triggerCategoryRemovedNotification(Title $categoryTitle)
Create a recentchanges entry for category removals.
triggerCategoryAddedNotification(Title $categoryTitle)
Create a recentchanges entry for category additions.
int $numTemplateLinks
Number of pages this WikiPage is embedded by Set by CategoryMembershipChange::checkTemplateLinks()
getUser()
Get the user associated with this change.
string $timestamp
Current timestamp, set during CategoryMembershipChange::__construct()
Revision null $revision
Latest Revision instance of the categorized page.
Title $pageTitle
Title instance of the categorized page.
notifyCategorization( $timestamp, Title $categoryTitle, User $user=null, $comment, Title $pageTitle, $lastTimestamp, $revision, $added)
overrideNewForCategorizationCallback(callable $callback)
Overrides the default new for categorization callback This is intended for use while testing and will...
checkTemplateLinks()
Determines the number of template links for recursive link updates.
getVisibility()
Get the deletion bitfield of the revision.
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
Represents a title within MediaWiki.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
static newFromId( $id)
Static factory method for creation from a given user ID.
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
this hook is for auditing only or null if authentication failed before getting that far $username
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user