r37519 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37518‎ | r37519 | r37520 >
Date:18:04, 10 July 2008
Author:simetrical
Status:old
Tags:
Comment:
Fixes for r37489:
* Don't pass $data or $flags by reference. They're never accessed again, so it makes no sense.
* Document in hooks.txt.
The interface for this hook seems very messy. It seems like it would be much cleaner to expose $data as $url (null if stored locally); and $flags as an array, or something like that. If the text is gzipped, the text can be extracted from the Revision and re-gzipped if you really want to for some strange reason.
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/Revision.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -1011,7 +1011,13 @@
10121012 $user: the User object to load preferences from
10131013
10141014 'RevisionInsertComplete': called after a revision is inserted into the DB
1015 -$revision: the Revision
 1015+&$revision: the Revision
 1016+$data: the data stored in old_text. The meaning depends on $flags: if external
 1017+ is set, it's the URL of the revision text in external storage; otherwise,
 1018+ it's the revision text itself. In either case, if gzip is set, the revision
 1019+ text is gzipped.
 1020+$flags: a comma-delimited list of strings representing the options used. May
 1021+ include: utf8 (this will always be set for new revisions); gzip; external.
10161022
10171023 'SavePreferences': called at the end of PreferencesForm::savePreferences;
10181024 returning false prevents the preferences from being saved.
Index: trunk/phase3/includes/Revision.php
@@ -773,7 +773,7 @@
774774
775775 $this->mId = !is_null($rev_id) ? $rev_id : $dbw->insertId();
776776
777 - wfRunHooks( 'RevisionInsertComplete', array( &$this, &$data, &$flags ) );
 777+ wfRunHooks( 'RevisionInsertComplete', array( &$this, $data, $flags ) );
778778
779779 wfProfileOut( __METHOD__ );
780780 return $this->mId;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r37489Extend RevisionInsertComplete hook (bug 14780)aaron10:30, 10 July 2008

Status & tagging log