Index: trunk/extensions/Preloader/Preloader.php |
— | — | @@ -17,7 +17,6 @@ |
18 | 18 | exit( 1 ); |
19 | 19 | } |
20 | 20 | |
21 | | -$wgExtensionFunctions[] = 'efPreloader'; |
22 | 21 | $wgExtensionCredits['other'][] = array( |
23 | 22 | 'path' => __FILE__, |
24 | 23 | 'name' => 'Preloader', |
— | — | @@ -33,21 +32,21 @@ |
34 | 33 | */ |
35 | 34 | $wgPreloaderSource[ NS_MAIN ] = 'Template:Preload'; |
36 | 35 | |
37 | | -function efPreloader() { |
38 | | - new Preloader(); |
39 | | -} |
| 36 | +$wgHooks['EditFormPreloadText'][] = 'Preloader::mainHook'; |
| 37 | +$wgHooks['ParserFirstCallInit'][] = 'Preloader::setParserHook'; |
40 | 38 | |
41 | 39 | class Preloader { |
42 | 40 | |
43 | | - function __construct() { |
44 | | - $this->setHooks(); |
| 41 | + public static function setParserHook( $parser ) { |
| 42 | + $parser->setHook( 'nopreload', array( __CLASS__, 'parserHook' ) ); |
| 43 | + return true; |
45 | 44 | } |
46 | 45 | |
47 | 46 | /** Hook function for the preloading */ |
48 | | - function mainHook( &$text, &$title ) { |
49 | | - $src = $this->preloadSource( $title->getNamespace() ); |
| 47 | + public static function mainHook( &$text, &$title ) { |
| 48 | + $src = self::preloadSource( $title->getNamespace() ); |
50 | 49 | if( $src ) { |
51 | | - $stx = $this->sourceText( $src ); |
| 50 | + $stx = self::sourceText( $src ); |
52 | 51 | if( $stx ) |
53 | 52 | $text = $stx; |
54 | 53 | } |
— | — | @@ -55,7 +54,7 @@ |
56 | 55 | } |
57 | 56 | |
58 | 57 | /** Hook function for the parser */ |
59 | | - function parserHook( $input, $args, &$parser ) { |
| 58 | + public static function parserHook( $input, $args, &$parser ) { |
60 | 59 | $output = $parser->parse( $input, $parser->getTitle(), $parser->getOptions(), false, false ); |
61 | 60 | return $output->getText(); |
62 | 61 | } |
— | — | @@ -67,7 +66,7 @@ |
68 | 67 | * @param $namespace Namespace to check for |
69 | 68 | * @return mixed |
70 | 69 | */ |
71 | | - function preloadSource( $namespace ) { |
| 70 | + static function preloadSource( $namespace ) { |
72 | 71 | global $wgPreloaderSource; |
73 | 72 | if( isset( $wgPreloaderSource[ $namespace ] ) ) { |
74 | 73 | return $wgPreloaderSource[ $namespace ]; |
— | — | @@ -82,11 +81,11 @@ |
83 | 82 | * @param $page Text form of the page title |
84 | 83 | * @return mixed |
85 | 84 | */ |
86 | | - function sourceText( $page ) { |
| 85 | + static function sourceText( $page ) { |
87 | 86 | $title = Title::newFromText( $page ); |
88 | 87 | if( $title && $title->exists() ) { |
89 | 88 | $revision = Revision::newFromTitle( $title ); |
90 | | - return $this->transform( $revision->getText() ); |
| 89 | + return self::transform( $revision->getText() ); |
91 | 90 | } else { |
92 | 91 | return false; |
93 | 92 | } |
— | — | @@ -98,14 +97,7 @@ |
99 | 98 | * @param $text |
100 | 99 | * @return string |
101 | 100 | */ |
102 | | - function transform( $text ) { |
| 101 | + static function transform( $text ) { |
103 | 102 | return trim( preg_replace( '/<nopreload>.*<\/nopreload>/s', '', $text ) ); |
104 | 103 | } |
105 | | - |
106 | | - /** Register the hook functions with MediaWiki */ |
107 | | - function setHooks() { |
108 | | - global $wgHooks, $wgParser; |
109 | | - $wgHooks['EditFormPreloadText'][] = array( &$this, 'mainHook' ); |
110 | | - $wgParser->setHook( 'nopreload', array( &$this, 'parserHook' ) ); |
111 | | - } |
112 | 104 | } |
Index: trunk/extensions/uniwiki/Layouts/Layouts.php |
— | — | @@ -43,10 +43,10 @@ |
44 | 44 | |
45 | 45 | /* ---- TAGS ---- */ |
46 | 46 | |
47 | | -$wgExtensionFunctions[] = "UW_Layouts_EF"; |
48 | | -function UW_Layouts_EF() { |
49 | | - global $wgParser; |
50 | | - $wgParser->setHook ( "layout", "UW_Layouts_EF_Render" ); |
| 47 | +$wgHooks['ParserFirstCallInit'][] = 'UW_Layouts_ParserFirstCallInit'; |
| 48 | +function UW_Layouts_ParserFirstCallInit( $parser ) { |
| 49 | + $parser->setHook( 'layout', 'UW_Layouts_EF_Render' ); |
| 50 | + return true; |
51 | 51 | } |
52 | 52 | |
53 | 53 | /* render a note to display the name of the |
Index: trunk/extensions/Seealso/Seealso.php |
— | — | @@ -19,30 +19,26 @@ |
20 | 20 | 'descriptionmsg' => 'seealso-desc', |
21 | 21 | ); |
22 | 22 | |
23 | | -$wgExtensionFunctions[] = "wfSeealso"; |
| 23 | +$wgHooks['ParserFirstCallInit'][] = 'wfSeealsoSetHooks'; |
24 | 24 | |
25 | 25 | $dir = dirname(__FILE__) . '/'; |
26 | 26 | $wgExtensionMessagesFiles['seealso'] = $dir . 'Seealso.i18n.php'; |
27 | 27 | |
28 | | -function wfSeealso () { |
29 | | - wfLoadExtensionMessages( 'seealso' ); |
30 | | - global $wgParser ; |
31 | | - $wgParser->setHook ('seealso', 'parse_seealso' ) ; |
| 28 | +function wfSeealsoSetHooks( $parser ) { |
| 29 | + $parser->setHook( 'seealso', 'parse_seealso' ); |
32 | 30 | $l = trim ( 'seealso-local', "" ) ; |
33 | 31 | if ( $l != "" ) |
34 | | - $wgParser->setHook ( $l , 'parse_seealso' ) ; |
| 32 | + $parser->setHook( $l, 'parse_seealso' ); |
| 33 | + return true; |
35 | 34 | } |
36 | 35 | |
37 | | -function parse_seealso ( $text, $params, &$parser ) { |
38 | | - $a = explode ( "\n" , $text ) ; |
39 | | - $ret = "== " . trim ( wfMsg('seealso')) . " ==\n" ; |
| 36 | +function parse_seealso( $text, $params, $parser ) { |
| 37 | + $a = explode ( "\n" , $text ); |
| 38 | + $ret = "== " . trim ( wfMsg( 'seealso' ) ) . " ==\n"; |
40 | 39 | foreach ( $a AS $x ) { |
41 | 40 | $x = trim ( $x ) ; |
42 | | - if ( $x == "" ) continue ; |
43 | | - $ret .= "* [[" . $x . "]]\n" ; |
| 41 | + if ( $x == "" ) continue; |
| 42 | + $ret .= "* [[" . $x . "]]\n"; |
44 | 43 | } |
45 | | - $p = new Parser ; |
46 | | - $ret = $p->parse ( $ret , $parser->getTitle() , $parser->getOptions(), false ) ; |
47 | | - $ret = $ret->getText(); |
48 | | - return $ret ; |
| 44 | + return $parser->recursiveTagParse( $ret ); |
49 | 45 | } |
Index: trunk/extensions/WiktionaryInflection/WiktionaryInflection.php |
— | — | @@ -7,11 +7,11 @@ |
8 | 8 | 'author' => '', |
9 | 9 | ); |
10 | 10 | |
11 | | -$wgExtensionFunctions[] = "wfInflectionExtension"; |
| 11 | +$wgHooks['ParserFirstCallInit'][] = 'wfInflectionSetHook'; |
12 | 12 | |
13 | | -function wfInflectionExtension() { |
14 | | - global $wgParser; |
15 | | - $wgParser->setHook("infl", "renderInflection"); |
| 13 | +function wfInflectionSetHook( $parser ) { |
| 14 | + $parser->setHook( 'infl', 'renderInflection' ); |
| 15 | + return true; |
16 | 16 | } |
17 | 17 | |
18 | 18 | class InflectionRule { |
Index: trunk/extensions/ScanSet/ScanSet.php |
— | — | @@ -21,12 +21,12 @@ |
22 | 22 | ); |
23 | 23 | |
24 | 24 | $wgExtensionMessagesFiles['ScanSet'] = dirname(__FILE__) . '/ScanSet.i18n.php'; |
25 | | -$wgExtensionFunctions[] = 'wfScanSetSetup'; |
| 25 | +$wgHooks['ParserFirstCallInit'][] = 'wfScanSetSetup'; |
26 | 26 | $wgScanSetSettings = array(); |
27 | 27 | |
28 | | -function wfScanSetSetup() { |
29 | | - global $wgParser; |
30 | | - $wgParser->setHook( 'scanset', 'wfScanSetHook' ); |
| 28 | +function wfScanSetSetup( $parser ) { |
| 29 | + $parser->setHook( 'scanset', 'wfScanSetHook' ); |
| 30 | + return true; |
31 | 31 | } |
32 | 32 | |
33 | 33 | function wfScanSetHook( $content, $params, &$parser ) { |
Index: trunk/extensions/UserRightsNotif/UserRightsNotif.php |
— | — | @@ -16,7 +16,6 @@ |
17 | 17 | die( 1 ); |
18 | 18 | } |
19 | 19 | |
20 | | -$wgExtensionFunctions[] = 'efUserRightsNotifierSetup'; |
21 | 20 | $wgExtensionCredits['other'][] = array( |
22 | 21 | 'path' => __FILE__, |
23 | 22 | 'name' => 'User Rights Email Notification', |
— | — | @@ -31,11 +30,7 @@ |
32 | 31 | # Change this to alter the email sender |
33 | 32 | $wgUserRightsNotif['sender'] = $wgPasswordSender; |
34 | 33 | |
35 | | -function efUserRightsNotifierSetup() { |
36 | | - global $wgHooks; |
37 | | - wfLoadExtensionMessages( 'UserRightsNotif' ); |
38 | | - $wgHooks['UserRights'][] = 'efUserRightsNotifier'; |
39 | | -} |
| 34 | +$wgHooks['UserRights'][] = 'efUserRightsNotifier'; |
40 | 35 | |
41 | 36 | function efUserRightsNotifier( &$user, $added, $removed ) { |
42 | 37 | global $wgUserRightsNotif; |
Index: trunk/extensions/SyntaxHighlight_vim/Syntax.php |
— | — | @@ -10,64 +10,58 @@ |
11 | 11 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
12 | 12 | */ |
13 | 13 | |
14 | | -$wgExtensionFunctions[] = 'wfSyntax'; |
15 | 14 | $wgExtensionCredits['other'][] = array( |
16 | 15 | 'name' => 'Syntax', |
17 | 16 | 'author' => 'Ævar Arnfjörð Bjarmason', |
18 | 17 | 'description' => 'A syntax highlight library' |
19 | 18 | ); |
20 | 19 | |
21 | | -function wfSyntax() { |
22 | | - wfUsePHP( 5.1 ); |
23 | | - wfUseMW( '1.6alpha' ); |
24 | | - |
25 | | - class Syntax { |
26 | | - private $mIn; |
27 | | - private $mInFile, $mOutFile; |
28 | | - private $mVimrc; |
| 20 | +class Syntax { |
| 21 | + private $mIn; |
| 22 | + private $mInFile, $mOutFile; |
| 23 | + private $mVimrc; |
29 | 24 | |
30 | | - public function __construct( $in, $format = null, $colorscheme = null, $background = null ) { |
31 | | - $this->mVimrc = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'vimrc.vim'; |
| 25 | + public function __construct( $in, $format = null, $colorscheme = null, $background = null ) { |
| 26 | + $this->mVimrc = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'vimrc.vim'; |
32 | 27 | |
33 | | - $this->mIn = $in; |
34 | | - } |
| 28 | + $this->mIn = $in; |
| 29 | + } |
35 | 30 | |
36 | | - public function getOut() { |
37 | | - $this->genTemp(); |
38 | | - |
39 | | - if ( ! $handle = fopen( $this->mInFile, 'a' ) ) |
40 | | - die( 'AAAAAAA' ); |
41 | | - if ( fwrite( $handle, $this->mIn ) === false ) |
42 | | - die( 'OOOOOOOOO' ); |
| 31 | + public function getOut() { |
| 32 | + $this->genTemp(); |
43 | 33 | |
44 | | - $html = $this->run(); |
| 34 | + if ( ! $handle = fopen( $this->mInFile, 'a' ) ) |
| 35 | + die( 'AAAAAAA' ); |
| 36 | + if ( fwrite( $handle, $this->mIn ) === false ) |
| 37 | + die( 'OOOOOOOOO' ); |
45 | 38 | |
46 | | - $html = preg_replace( '~^\s*<html>.*?<body.*?<pre>~s', '<pre style="background-color: black; color: gray">', $html ); |
47 | | - $html = preg_replace( '~</p>\s*</body>.*?$~s', '</style>', $html ); |
| 39 | + $html = $this->run(); |
48 | 40 | |
49 | | - $this->rmTemp(); |
50 | | - |
51 | | - return $html; |
52 | | - } |
| 41 | + $html = preg_replace( '~^\s*<html>.*?<body.*?<pre>~s', '<pre style="background-color: black; color: gray">', $html ); |
| 42 | + $html = preg_replace( '~</p>\s*</body>.*?$~s', '</style>', $html ); |
53 | 43 | |
54 | | - private function genTemp() { |
55 | | - $this->mInFile = $this->mktemp(); |
56 | | - $this->mOutFile = $this->mktemp(); |
57 | | - } |
58 | | - |
59 | | - private static function mktemp() { |
60 | | - return rtrim( shell_exec( 'mktemp -u' ), "\n" ); |
61 | | - } |
62 | | - |
63 | | - private function rmTemp() { |
64 | | - unlink( $this->mInFile ); |
65 | | - unlink( $this->mOutFile ); |
66 | | - } |
| 44 | + $this->rmTemp(); |
67 | 45 | |
68 | | - private function run() { |
69 | | - shell_exec( "vim -u {$this->mVimrc} -e +'run! syntax/2html.vim' +':w {$this->mOutFile}' +':qa!' {$this->mInFile}" ); |
70 | | - |
71 | | - return file_get_contents( $this->mOutFile ); |
72 | | - } |
| 46 | + return $html; |
73 | 47 | } |
| 48 | + |
| 49 | + private function genTemp() { |
| 50 | + $this->mInFile = $this->mktemp(); |
| 51 | + $this->mOutFile = $this->mktemp(); |
| 52 | + } |
| 53 | + |
| 54 | + private static function mktemp() { |
| 55 | + return rtrim( shell_exec( 'mktemp -u' ), "\n" ); |
| 56 | + } |
| 57 | + |
| 58 | + private function rmTemp() { |
| 59 | + unlink( $this->mInFile ); |
| 60 | + unlink( $this->mOutFile ); |
| 61 | + } |
| 62 | + |
| 63 | + private function run() { |
| 64 | + shell_exec( "vim -u {$this->mVimrc} -e +'run! syntax/2html.vim' +':w {$this->mOutFile}' +':qa!' {$this->mInFile}" ); |
| 65 | + |
| 66 | + return file_get_contents( $this->mOutFile ); |
| 67 | + } |
74 | 68 | } |
Index: trunk/extensions/SyntaxHighlight_vim/SyntaxHook.php |
— | — | @@ -10,35 +10,22 @@ |
11 | 11 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
12 | 12 | */ |
13 | 13 | |
14 | | -$wgExtensionFunctions[] = 'wfSyntaxHook'; |
15 | 14 | $wgExtensionCredits['parserhook'][] = array( |
16 | 15 | 'name' => 'Syntax', |
17 | 16 | 'author' => 'Ævar Arnfjörð Bjarmason', |
18 | 17 | 'description' => 'adds a <code><syntax></code> parser hook for highlighting' |
19 | 18 | ); |
20 | 19 | |
21 | | -function wfSyntaxHook() { |
22 | | - wfUsePHP( 5.1 ); |
23 | | - wfUseMW( '1.6alpha' ); |
24 | | - |
25 | | - class SyntaxHook { |
26 | | - public function __construct() { |
27 | | - $this->setHook(); |
28 | | - } |
29 | | - |
30 | | - private function setHook() { |
31 | | - global $wgParser; |
| 20 | +$wgHooks['ParserFirstCallInit'][] = 'wfSyntaxHighlightVimSetHook'; |
32 | 21 | |
33 | | - $wgParser->setHook( 'syntax', array( $this, 'hook' ) ); |
34 | | - } |
| 22 | +function wfSyntaxHighlightVimSetHook( $parser ) { |
| 23 | + $parser->setHook( 'syntax', 'wfSyntaxHighlightVimRender' ); |
| 24 | + return true; |
| 25 | +} |
35 | 26 | |
36 | | - public function hook( $in, array $argv ) { |
37 | | - $in = ltrim( $in, "\n" ); |
38 | | - $syntax = new Syntax( $in ); |
| 27 | +function wfSyntaxHighlightVimRender( $in, array $argv ) { |
| 28 | + $in = ltrim( $in, "\n" ); |
| 29 | + $syntax = new Syntax( $in ); |
39 | 30 | |
40 | | - return $syntax->getOut(); |
41 | | - } |
42 | | - } |
43 | | - |
44 | | - new SyntaxHook; |
| 31 | + return $syntax->getOut(); |
45 | 32 | } |
Index: trunk/extensions/TagContent/TagContent.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | 'description' => 'Translate from tags to parser functions' |
41 | 41 | ); |
42 | 42 | |
43 | | -$wgExtensionFunctions[] = 'efTagContentSetup'; |
| 43 | +$wgHooks['ParserFirstCallInit'][] = 'efTagContentSetHooks'; |
44 | 44 | $wgExtensionMessagesFiles['TagContent'] = dirname(__FILE__) . '/TagContent.i18n.php'; |
45 | 45 | |
46 | 46 | $egTagContentDefine = array( |
— | — | @@ -195,14 +195,14 @@ |
196 | 196 | * Setup function for the extension |
197 | 197 | @return True is returned unconditionally |
198 | 198 | */ |
199 | | -function efTagContentSetup () { |
200 | | - global $wgParser, $egTagContentBlacklist, $egTagContentDefine; |
| 199 | +function efTagContentSetHooks( $parser ) { |
| 200 | + global $egTagContentBlacklist, $egTagContentDefine; |
201 | 201 | wfLoadExtensionMessages('TagContent'); |
202 | 202 | foreach ($egTagContentDefine as $k => $a) { |
203 | 203 | $template = $a[0]; |
204 | 204 | $tag = strtolower($k); |
205 | 205 | $c = new TagContent($tag, $template, $a[1], false); |
206 | | - $wgParser->setHook( $tag, array( $c, 'onRender' )); |
| 206 | + $parser->setHook( $tag, array( $c, 'onRender' )); |
207 | 207 | } |
208 | 208 | $defs = explode("\n", wfMsgNoTrans( 'tags-definition' )); |
209 | 209 | foreach ($defs as $line) { |
— | — | @@ -213,7 +213,7 @@ |
214 | 214 | $tag = strtolower(trim($a[0])); |
215 | 215 | if ( !$egTagContentBlacklist[$tag] && !isset($egTagContentDefine[$tag])) { |
216 | 216 | $c = new TagContent($tag, $template, $a[2], true); |
217 | | - $wgParser->setHook( $tag, array( $c, 'onRender' )); |
| 217 | + $parser->setHook( $tag, array( $c, 'onRender' )); |
218 | 218 | } |
219 | 219 | } |
220 | 220 | } |
Index: trunk/extensions/Sort/Sort.php |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | } |
18 | 18 | |
19 | 19 | $wgAutoloadClasses['Sorter'] = dirname( __FILE__ ) . '/Sort.class.php'; |
20 | | -$wgExtensionFunctions[] = 'efSort'; |
| 20 | +$wgHooks['ParserFirstCallInit'][] = 'efSortSetHook'; |
21 | 21 | $wgExtensionCredits['parserhook'][] = array( |
22 | 22 | 'path' => __FILE__, |
23 | 23 | 'name' => 'Sort', |
— | — | @@ -28,9 +28,9 @@ |
29 | 29 | /** |
30 | 30 | * Register hook function |
31 | 31 | */ |
32 | | -function efSort() { |
33 | | - global $wgParser; |
34 | | - $wgParser->setHook( 'sort', 'efRenderSort' ); |
| 32 | +function efSortSetHook( $parser ) { |
| 33 | + $parser->setHook( 'sort', 'efRenderSort' ); |
| 34 | + return true; |
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
Index: trunk/extensions/YouTubeAuthSub/YouTubeAuthSub.php |
— | — | @@ -15,8 +15,6 @@ |
16 | 16 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
17 | 17 | */ |
18 | 18 | |
19 | | -$wgExtensionFunctions[] = 'wfYouTubeAuthSub'; |
20 | | - |
21 | 19 | $wgYTAS_UseClientLogin = true; |
22 | 20 | |
23 | 21 | # Fill out if you are using $wgUseClientLogin |
— | — | @@ -44,13 +42,9 @@ |
45 | 43 | $wgAutoloadClasses['SpecialYouTubeAuthSub'] = $dir . 'YouTubeAuthSub_body.php'; |
46 | 44 | $wgSpecialPages['YouTubeAuthSub'] = 'SpecialYouTubeAuthSub'; |
47 | 45 | |
48 | | -function wfYouTubeAuthSub() { |
49 | | - global $wgYTAS_UseNamespace, $wgExtraNamespaces; |
| 46 | +$wgExtraNamespaces[NS_YOUTUBE] = "YouTube"; |
| 47 | +$wgExtraNamespaces[NS_YOUTUBE_TALK] = "YouTube_talk"; |
50 | 48 | |
51 | | - $wgExtraNamespaces[NS_YOUTUBE] = "YouTube"; |
52 | | - $wgExtraNamespaces[NS_YOUTUBE_TALK] = "YouTube_talk"; |
53 | | -} |
54 | | - |
55 | 49 | function wfSpecialYouTubePost ($url, $content, $headers = null) { |
56 | 50 | // Set the date of your post |
57 | 51 | $issued=gmdate("Y-m-d\TH:i:s\Z", time()); |
Index: trunk/extensions/RSSNews/RSSNews.php |
— | — | @@ -10,11 +10,11 @@ |
11 | 11 | 'url' => 'http://www.mediawiki.org/wiki/Extension:RSSNews', |
12 | 12 | ); |
13 | 13 | |
14 | | -$wgExtensionFunctions[] = "wfRSSFeedExtension"; |
| 14 | +$wgHooks['ParserFirstCallInit'][] = 'wfRSSFeedSetHook'; |
15 | 15 | |
16 | | -function wfRSSFeedExtension() { |
17 | | - global $wgParser; |
18 | | - $wgParser->setHook( "rss", "renderRSS" ); |
| 16 | +function wfRSSFeedSetHook( $parser ) { |
| 17 | + $parser->setHook( 'rss', 'renderRSS' ); |
| 18 | + return true; |
19 | 19 | } |
20 | 20 | |
21 | 21 | function renderRSS( $paramstring ) { |
Index: trunk/extensions/UserImages/UserImages.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | $dir = dirname(__FILE__) . '/'; |
29 | 29 | $wgExtensionMessagesFiles['UserImages'] = $dir . 'UserImages.i18n.php'; |
30 | 30 | $wgAutoloadClasses['UserImagesGallery'] = $dir . 'UserImages.class.php'; |
31 | | -$wgExtensionFunctions[] = 'efUserImages'; |
| 31 | +$wgHooks['ParserFirstCallInit'][] = 'efUserImagesSetHook'; |
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Set this to true to disable the parser cache for pages which |
— | — | @@ -39,9 +39,9 @@ |
40 | 40 | /** |
41 | 41 | * Extension initialisation function |
42 | 42 | */ |
43 | | -function efUserImages() { |
44 | | - global $wgParser; |
45 | | - $wgParser->setHook( 'userimages', 'efUserImagesRender' ); |
| 43 | +function efUserImagesSetHook( $parser ) { |
| 44 | + $parser->setHook( 'userimages', 'efUserImagesRender' ); |
| 45 | + return true; |
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
Index: trunk/extensions/TemplateLink/TemplateLink.setup.php |
— | — | @@ -43,11 +43,11 @@ |
44 | 44 | $wgSpecialPages['TemplateLink'] = 'TemplateLink'; # Let MediaWiki know about your new special page. |
45 | 45 | |
46 | 46 | # The tag |
47 | | -$wgExtensionFunctions[] = 'efTemplateLinkSetup'; |
| 47 | +$wgHooks['ParserFirstCallInit'][] = 'efTemplateLinkSetHook'; |
48 | 48 | |
49 | | -function efTemplateLinkSetup(){ |
50 | | - global $wgParser; |
51 | | - $wgParser->setHook( 'templatelink', 'efTemplateLink' ); |
| 49 | +function efTemplateLinkSetHook( $parser ){ |
| 50 | + $parser->setHook( 'templatelink', 'efTemplateLink' ); |
| 51 | + return true; |
52 | 52 | } |
53 | 53 | |
54 | 54 | function efTemplateLink( $input, $args, $parser ){ |