Last modified: 2013-09-04 11:48:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T33046, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31046 - Skin .deps.php using a define instead of dirname() to guess the base directory
Skin .deps.php using a define instead of dirname() to guess the base directory
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Templates (Other open bugs)
1.17.x
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-20 21:22 UTC by Ryan Schulze
Modified: 2013-09-04 11:48 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Ryan Schulze 2011-09-20 21:22:14 UTC
The .deps.php files in the skin directory use the following snippet to load SkinTemplate.php:

require_once( dirname( dirname( __FILE__ ) ) . '/includes/SkinTemplate.php');

This assumes that the skin directory is in a specific place (which does not have to be the case if $wgStyleDirectory is used, especially useful for multi-site installations with the same source code directory).

It would be more elegant to find the base path once and store it for later use, instead of having scripts guess each time they are called.

As a workaround I currently ensure that MW_INSTALL_PATH is set in my LocalSettings.php and use that, there is probably some other define that I haven't noticed yet that works just as fine or is better suited.

require_once( MW_INSTALL_PATH . '/includes/SkinTemplate.php');
Comment 1 Daniel Friesen 2011-09-20 21:24:33 UTC
Aren't .deps.php files be loaded at a point where $IP is set?
Comment 2 Daniel Friesen 2011-09-20 21:25:49 UTC
Actually, for that matter... all that matters is that we make sure that the relevant classes are loaded. Wouldn't using `AutoLoader::loadClass( 'SkinTemplate' );` etc... make more sense.
Comment 3 Brion Vibber 2011-09-20 23:04:08 UTC
Check whether these files are still required at all -- they were added years ago as a workaround for a specific APC bug that required us to load some classes in a particular order or they'd intermittently break.
Comment 4 Daniel Friesen 2011-09-20 23:43:09 UTC
http://lists.wikimedia.org/pipermail/wikitech-l/2006-January/021311.html
http://pecl.php.net/bugs/bug.php?id=6503

Tim commented that the 'fix' to the bug was to treat that situation as a cache miss instead of as something that would cause a fatal error, so it's possible that while the bug may not cause things to break anymore, it may cause performance issues.
Comment 5 Bartosz Dziewoński 2012-11-01 18:24:46 UTC
Resolving as invalid. These files no longer exist for quite some time, see bug 37194.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links