The support requests for users with "PHP Fatal error: Cannot redeclare
wfProfileIn()" continue in #mediawiki.
My idea on how to fix the issue previously was to include in 1.18.1
(whenever we release it) an includes/ProfilerStub.php with something like:
<?php wfDeprecated( 'includes/ProfilerStub.php' );
So that it would override any dead includes/ProfilerStub.php from an old
version of MediaWiki and the bad require_once people still have would just
become a no-op and things would continue working.
I've been starting to think that in 1.19 we should drop StartProfiler.php
altogether.
StartProfiler.php simply exists to initiate the profiler. It's basically a
LocalSettings.php that runs before LocalSettings.php
Back in 1.17 we loaded things in the order:
StartProfiler, Defines, AutoLoader, DefaultSettings, LocalSettings
However the order we load things now is:
Init, AutoLoader, Profiler, Defines, StartProfiler, DefaultSettings,
LocalSettings
So there is absolutely no extra value to StartProfiler now since it loads
directly before our settings and can no longer profile things before the
settings.
To top it off we have comments like these in our code:
# Include site settings. $IP may be changed (hopefully before the
AutoLoader is invoked)
If $IP is changed, it's naturally going to be changed in LocalSettings.php
We're 'hoping' the AutoLoader won't be invoked until AFTER $IP is
modified. But loading StartProfiler BEFORE it and recommending patterns
that might invoke the AutoLoader.
Considering the support requests we get related to bad StartProfiler.php
files, the bad documentation on how to setup StartProfiler.php, and the
fact it doesn't add any advantage over LocalSettings.php anymore. I'm
thinking we should stop including StartProfiler.php and just make anyone
who actually wants to use the profiler move their profiler configuration
into LocalSettings.php with the rest of their config.
We could include a debug line if we want:
if ( is_readable( "$IP/StartProfiler.php" ) ) {
wfDebug( 'You have a outdated StartProfiler.php in your install which is
no longer in use. We recommend you delete it and move any profiler config
you wish to keep into your LocalSettings.php' );
}
--
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l