r73035 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73034‎ | r73035 | r73036 >
Date:01:02, 15 September 2010
Author:tparscal
Status:resolved (Comments)
Tags:
Comment:
Using hook for registering resources.
Modified paths:
  • /trunk/phase3/includes/ResourceLoader.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ResourceLoader.php
@@ -325,5 +325,5 @@
326326 }
327327 }
328328
329 -// FIXME: Temp hack
330 -require_once "$IP/resources/Resources.php";
 329+ResourceLoader::register( include( "$IP/resources/Resources.php" ) );
 330+wfRunHook( 'ResourceLoaderRegisterModules' );
\ No newline at end of file

Comments

#Comment by Nikerabbit (talk | contribs)   06:59, 15 September 2010

No file level code please. It breaks if the class is autoloaded too early:

Fatal error: Call to undefined function wfRunHooks() in /www/sandwiki/includes/ResourceLoader.php on line 329
#Comment by Catrope (talk | contribs)   15:02, 15 September 2010

Not only does this break, it also defeats the purpose of the hook, which is to lazy-load registrations.

#Comment by Trevor Parscal (WMF) (talk | contribs)   18:37, 15 September 2010

Right - I think I was too tired and working too late... This is all fixed up in r73076, r73077 and r73078.

Status & tagging log