Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Aug 2010 at 09:36 UTC
Updated:
5 Mar 2011 at 13:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
damien tournoud commentedRasmus or not, no way we convert those require_once to require. The difference is minimum and the first is *way* more reliable.
Comment #2
pwolanin commentedStill makes sense to just use require to me.
Comment #3
pwolanin commentedComment #4
damien tournoud commentedChanging those require_once() to require() doesn't make any real difference in terms of performance, and would make the whole bootstrap process less robust.
For example, if a warning is triggered during bootstrap process, for example, error.inc will be loaded, and the require() call will explode, a module could want to load unicode.inc during a hook_boot, etc.
I'm not sure about removing the static, it seems to make sense to me.
Comment #6
pwolanin commentedminimal patch
Comment #8
pounardWhy do you want to replace
require_onceusingrequire?require_onceis better and good for you. OPCode caches all optimize this method, and it may avoid potential crashes if somes modules attempt to require some of these files by themselves (using a light bootstrap or any other context likehook_boot()or such).Here is a patch attached, that also fixes the wrong
drupal_static()usage made infix_gpc_magic(). If a miracle happens and this bootstrap method is run more than once, after thedrupal_static()registry has been cleared, doing twicefix_gpc_magic()would totally break superglobals content.Comment #9
pounardComment #10
dries commentedThis looks RTBC to me, but I want to give it bit more time for additional reviews.
Comment #11
pounardNice, thanks.
Comment #12
damien tournoud commentedLooks good to me too.
Comment #13
pounardIf I had one thing to add, it would be a good comment about why those are not drupal_static() calls. It may worth it since a lot of developers could read this code and ask themselves why.
Comment #14
dries commentedCommitted to CVS HEAD. Thanks.