Last modified: 2014-08-17 11:38:24 UTC
I am running under IIS with the files stored on network storage. I get an error from line 1142 in includes\AutoLoader.php when the $filename being passed is already a network share. Specifically in my case it then adds $IP a second time. Here are the variables from my situation: From debugging we know that: $IP is set to "\\server\share\mediawiki" The offending class being loaded in LocalSettings.php: require_once("$IP/extensions/WikiEditor/WikiEditor.php" ); After line 1142 $filename = "\\server\share\mediawiki\\server\share\mediawiki\extensions\WikiEditor\WikiEditor.php" Line 1140 checks if the first character is a / (root), or the second character is a : (windows local drive). To work around the problem I added a third check, that the second character is a slash (windows network share): if ( substr( $filename, 0, 1 ) != '/' && substr( $filename, 1, 1 ) != ':' && substr( $filename, 1, 1 ) != '\\') {
Sorry to avoid confusion - the actual error is at line 1145 when the incorrect $filename tries to get required.
I think you're confusing "require" with "autoloading". The require_once() call you mention: > require_once("$IP/extensions/WikiEditor/WikiEditor.php" ); that isn't a class but an extension file. This is your own code and placed in your LocalSettings.php, correct? AutoLoader isn't involved there. > After line 1142 $filename = > "\\server\share\mediawiki\\server\share\mediawiki\extensions\WikiEditor\WikiEditor.php" Line 1142/1145 of which file? Assuming AutoLoader.php, why is WikiEditor listed in your autoloader configuration?
Please confirm that this is a MediaWiki related problem. Otherwise this issue should be closed.
I experienced the same issue after upgrading to the latest version of GearHost.com's cloudsites platform, which too changed from local drive storage to a network share. Like the original poster, I found the same behavior. Additionally, though, I found that commenting the require_once("$IP/extensions/WikiEditor/WikiEditor.php" ); line would temporarily resolve the issue and allow MediaWiki to load, which suggests some dependency between require_once and the autoloader. I applied a similar change to the autoloader file which allowed to uncomment the require_once line successfully. I am running MediaWiki 1.19.1.
I forgot about this bug - upgraded my mediawiki to latest snapshot of 1.22 and the issue came back. The issue isn't related to a particular extension, but to the use of the AutoLoader. Above the samples were with WikiEditor. This time I came across it with VisualEditor which uses AutoLoader. In 1.22 latest snapshot 7/16/2013 line 1148-1152 of file includes\AutoLoader.php: # Make an absolute path, this improves performance by avoiding some stat calls if ( substr( $filename, 0, 1 ) != '/' && substr( $filename, 1, 1 ) != ':' ) { global $IP; $filename = "$IP/$filename"; } This handles the case where $filename is a linux full path (starting at /) or a windows full path (with the drive letter i.e. c:) but does not handle the case of a network share on windows (\\server\path) Again fix in first message does address this: if ( substr( $filename, 0, 1 ) != '/' && substr( $filename, 1, 1 ) != ':' && substr( $filename, 0, 2 ) != '\\\\') Adjusted to look specifically for two forward slashes in case there's some other case where one forward slash is ok?