We need this 'AfterFinalPageOutput' hook for the STTLanguage extension.
authorDaniel Werner <daniel.werner@wikimedia.de>
Wed, 4 Jul 2012 21:23:56 +0000 (23:23 +0200)
committerDaniel Werner <daniel.werner@wikimedia.de>
Wed, 4 Jul 2012 21:23:56 +0000 (23:23 +0200)
Change-Id: I1f131e87324cb7a62355dc296f0b4d411a9a0800

RELEASE-NOTES-1.20
docs/hooks.txt
includes/OutputPage.php

index 3c545ee..46d8504 100644 (file)
@@ -74,6 +74,8 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki.
 * Added new function getDomain to AuthPlugin for getting a user's domain
 * (bug 23427) New magic word {{PAGEID}} which gives the current page ID.
   Will be null on previewing a page being created.
+* Added new hook AfterFinalPageOutput to allow modifications to buffered page output before sent
+  to the client.
 
 === Bug fixes in 1.20 ===
 * (bug 30245) Use the correct way to construct a log page title.
index d32612d..dd67631 100644 (file)
@@ -279,6 +279,11 @@ $article: Article object
 $user: the User object that was created. (Parameter added in 1.7)
 $byEmail: true when account was created "by email" (added in 1.12)
 
+'AfterFinalPageOutput': At the end of OutputPage::output() but before
+final ob_end_flush() which will send the buffered output to the client.
+This allows for last-minute modification of the output within the buffer
+by using ob_get_clean().
+
 'AfterImportPage': When a page import is completed
 $title: Title under which the revisions were imported
 $origTitle: Title provided by the XML file
index 7f0a4e2..e96c61f 100644 (file)
@@ -1989,7 +1989,11 @@ class OutputPage extends ContextSource {
                }
 
                $this->sendCacheControl();
+
+               wfRunHooks( 'AfterFinalPageOutput', array( &$this ) );
+
                ob_end_flush();
+
                wfProfileOut( __METHOD__ );
        }