Last modified: 2010-05-15 15:38:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 2569 - MediaWiki deals wrong with path separators on NetWare
MediaWiki deals wrong with path separators on NetWare
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.5.x
Other other
: Normal normal with 3 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
http://www.gknw.de/test/mediawiki/
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-28 14:17 UTC by Guenter Knauf
Modified: 2010-05-15 15:38 UTC (History)
0 users

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


Attachments

Description Guenter Knauf 2005-06-28 14:17:56 UTC
Hi all,
I wanted to install MediaWiki on NetWare platform - but surprisingly that failed because 
the path separator is choosen wrong.
So I examined MediaWiki, and found that the path separator selection is not very well 
developed...
here's my patch which makes MediaWiki install on NetWare:
http://www.gknw.com/test/mediawiki/mydiff1
perhaps not needed, but when we are on path separators these I found also:
http://www.gknw.com/test/mediawiki/mydiff2
and I think the path separator selection should be the same with all files.

Hope someone can soon commit these trivial patches so that MediaWiki can install out-of-
the-box on NetWare too....

greets, Guenter.
Comment 1 Guenter Knauf 2005-09-01 00:32:24 UTC
Tested now 1.47, 1.49, and 1.5rc4 - still no sign of a fix....
with 1.5rc4 version the first patch has slightly changed:
--- index.php.orig	Sat Aug 13 09:31:32 2005
+++ index.php	Thu Sep 01 02:03:50 2005
@@ -114,7 +114,11 @@
 # As a dirty hack, we'll try to set up the include path first.
 #
 $IP = dirname( dirname( __FILE__ ) );
-$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+if (PATH_SEPARATOR != "") {
+	$sep = PATH_SEPARATOR;
+} else {
+	$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+}
 ini_set( "include_path", ".$sep$IP$sep$IP/includes$sep$IP/languages" );
 
 define( "MEDIAWIKI", true );
@@ -1070,7 +1074,11 @@
 		$slconf['RightsIcon'] = $conf->RightsIcon;
 	}
 
-	$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+	if (PATH_SEPARATOR != "") {
+		$sep = PATH_SEPARATOR;
+	} else {
+		$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+	}
 	$localsettings = "
 # This file was automatically generated by the MediaWiki installer.
 # If you make manual changes, please keep track in case you need to

Comment 2 Brion Vibber 2005-09-01 01:07:37 UTC
This patch looks wrong; an undefined constant will not evaluate to "" but rather to 
the string of its own name. Thus on PHP versions lacking the predefined PATH_SEPARATOR 
constant, it will attempt to use the string "PATH_SEPARATOR" when constructing the 
include path. Additionally a warning or notice message may be produced, depending on 
error reporting settings.

Use the defined() function to determine if a constant is defined.
Comment 3 Guenter Knauf 2005-09-01 18:51:58 UTC
ok, then take this one:
http://www.gknw.com/test/mediawiki/mydiff1-1.5
#============================================================================
# http://sourceforge.net/projects/wikipedia/
# MediaWiki 1.5rc4 patch to provide better path separator choose
# Apply this patch with: patch -p 0 -b -i mydiff1-1.5
#============================================================================
--- config/index.php.orig	Sat Aug 13 09:31:32 2005
+++ config/index.php	Thu Sep 01 19:41:36 2005
@@ -114,7 +114,11 @@
 # As a dirty hack, we'll try to set up the include path first.
 #
 $IP = dirname( dirname( __FILE__ ) );
-$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+if (defined(PATH_SEPARATOR)) {
+	$sep = PATH_SEPARATOR;
+} else {
+	$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+}
 ini_set( "include_path", ".$sep$IP$sep$IP/includes$sep$IP/languages" );
 
 define( "MEDIAWIKI", true );
@@ -1070,7 +1074,11 @@
 		$slconf['RightsIcon'] = $conf->RightsIcon;
 	}
 
-	$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+	if (defined(PATH_SEPARATOR)) {
+		$sep = PATH_SEPARATOR;
+	} else {
+		$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+	}
 	$localsettings = "
 # This file was automatically generated by the MediaWiki installer.
 # If you make manual changes, please keep track in case you need to

#============================================================================
--- maintenance/importPhase2.php.orig	Mon Feb 21 16:33:46 2005
+++ maintenance/importPhase2.php	Thu Sep 01 19:46:29 2005
@@ -48,7 +48,11 @@
 $wgDBuser = $wgDBadminuser;
 $wgDBpassword = $wgDBadminpassword;
 
-$sep = ( DIRECTORY_SEPARATOR == "\\" ) ? ";" : ":";
+if (defined(PATH_SEPARATOR)) {
+	$sep = PATH_SEPARATOR;
+} else {
+	$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+}
 ini_set( "include_path", "$IP$sep$include_path" );
 
 require_once( "Setup.php" );

#============================================================================

see also:
http://www.gknw.com/test/mediawiki/mydiff2-1.5

thanks, Guenter.
Comment 4 Brion Vibber 2005-09-01 21:11:05 UTC
Closer, but this will still cause a notice warning due to use of the undefined 
constant. You need to pass a string here, as: defined( "PATH_SEPARATOR" )
Comment 5 Guenter Knauf 2005-11-05 16:31:20 UTC
next round entered:
http://www.gknw.com/test/mediawiki/mediawiki-1.4.x.diff
#============================================================================
# http://sourceforge.net/projects/wikipedia/
# MediaWiki 1.4.x patch to provide better path separator choose
# Apply this patch with: patch -p 1 -i mediawiki-1.4.x.diff
#============================================================================
diff -ur mediawiki-1.4.12\config\index.php mediawiki-1.4.12p\config\index.php
--- mediawiki-1.4.12\config\index.phpThu Jun 23 00:08:02 2005
+++ mediawiki-1.4.12p\config\index.phpSat Nov 05 15:55:28 2005
@@ -113,7 +113,11 @@
 # As a dirty hack, we'll try to set up the include path first.
 #
 $IP = dirname( dirname( __FILE__ ) );
-$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+if (defined("PATH_SEPARATOR")) {
+$sep = PATH_SEPARATOR;
+} else {
+$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+}
 ini_set( "include_path", ".$sep$IP$sep$IP/includes$sep$IP/languages" );
 
 define( "MEDIAWIKI", true );
@@ -903,7 +907,11 @@
 $slconf['RightsIcon'] = $conf->RightsIcon;
 }
 
-$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+if (defined("PATH_SEPARATOR")) {
+$sep = PATH_SEPARATOR;
+} else {
+$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+}
 $localsettings = "
 # This file was automatically generated by the MediaWiki installer.
 # If you make manual changes, please keep track in case you need to
diff -ur mediawiki-1.4.12\maintenance\commandLine.inc mediawiki-1.4.
12p\maintenance\commandLine.inc
--- mediawiki-1.4.12\maintenance\commandLine.incFri Jun 24 23:39:28 2005
+++ mediawiki-1.4.12p\maintenance\commandLine.incSat Nov 05 16:01:48 2005
@@ -75,7 +75,11 @@
 $wgCommandLineMode = true;
 # Turn off output buffering if it's on
 @ob_end_flush();
-$sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
+if (defined("PATH_SEPARATOR")) {
+$sep = PATH_SEPARATOR;
+} else {
+$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+}
 
 if (!isset( $wgUseNormalUser ) ) {
 $wgUseNormalUser = false;
diff -ur mediawiki-1.4.12\maintenance\importPhase2.php mediawiki-1.4.
12p\maintenance\importPhase2.php
--- mediawiki-1.4.12\maintenance\importPhase2.phpSun Nov 14 23:50:24 2004
+++ mediawiki-1.4.12p\maintenance\importPhase2.phpSat Nov 05 15:59:10 2005
@@ -48,7 +48,11 @@
 $wgDBuser = $wgDBadminuser;
 $wgDBpassword = $wgDBadminpassword;
 
-$sep = ( DIRECTORY_SEPARATOR == "\\" ) ? ";" : ":";
+if (defined("PATH_SEPARATOR")) {
+$sep = PATH_SEPARATOR;
+} else {
+$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+}
 ini_set( "include_path", "$IP$sep$include_path" );
 
 require_once( "Setup.php" );
diff -ur mediawiki-1.4.12\maintenance\liveCmdLine.inc mediawiki-1.4.
12p\maintenance\liveCmdLine.inc
--- mediawiki-1.4.12\maintenance\liveCmdLine.incSat Nov 20 05:23:52 2004
+++ mediawiki-1.4.12p\maintenance\liveCmdLine.incSat Nov 05 16:01:46 2005
@@ -38,7 +38,11 @@
 $wgDBadminpassword = trim(`wikiadmin_pass`);
 }
 
-$sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
+if (defined("PATH_SEPARATOR")) {
+$sep = PATH_SEPARATOR;
+} else {
+$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+}
 putenv( "wikilang=$lang");
 $newpath = "/home/wikipedia/common/php-new$sep";
 
Comment 6 Guenter Knauf 2005-11-05 16:33:48 UTC
and here for 1.5.2:
http://www.gknw.com/test/mediawiki/mediawiki-1.5.2.diff
#============================================================================
# http://sourceforge.net/projects/wikipedia/
# MediaWiki 1.5.2 patch to provide better path separator choose
# Apply this patch with: patch -p 1 -i mediawiki-1.5.2.diff
#============================================================================
diff -ur mediawiki-1.5.2\config\index.php mediawiki-1.5.2p\config\index.php
--- mediawiki-1.5.2\config\index.phpFri Oct 28 11:02:36 2005
+++ mediawiki-1.5.2p\config\index.phpSat Nov 05 16:59:10 2005
@@ -114,7 +114,11 @@
 # As a dirty hack, we'll try to set up the include path first.
 #
 $IP = dirname( dirname( __FILE__ ) );
-$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+if (defined("PATH_SEPARATOR")) {
+$sep = PATH_SEPARATOR;
+} else {
+$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+}
 ini_set( "include_path", ".$sep$IP$sep$IP/includes$sep$IP/languages" );
 
 define( "MEDIAWIKI", true );
@@ -1107,7 +1111,11 @@
 $slconf['RightsIcon'] = $conf->RightsIcon;
 }
 
-$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+if (defined("PATH_SEPARATOR")) {
+$sep = PATH_SEPARATOR;
+} else {
+$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+}
 $localsettings = "
 # This file was automatically generated by the MediaWiki installer.
 # If you make manual changes, please keep track in case you need to
diff -ur mediawiki-1.5.2\maintenance\commandLine.inc mediawiki-1.5.
2p\maintenance\commandLine.inc
--- mediawiki-1.5.2\maintenance\commandLine.incSat Jul 02 11:05:00 2005
+++ mediawiki-1.5.2p\maintenance\commandLine.incSat Nov 05 16:59:30 2005
@@ -76,7 +76,11 @@
 $wgCommandLineMode = true;
 # Turn off output buffering if it's on
 @ob_end_flush();
-$sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
+if (defined("PATH_SEPARATOR")) {
+$sep = PATH_SEPARATOR;
+} else {
+$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+}
 
 if (!isset( $wgUseNormalUser ) ) {
 $wgUseNormalUser = false;
diff -ur mediawiki-1.5.2\maintenance\importPhase2.php mediawiki-1.5.
2p\maintenance\importPhase2.php
--- mediawiki-1.5.2\maintenance\importPhase2.phpMon Feb 21 16:33:46 2005
+++ mediawiki-1.5.2p\maintenance\importPhase2.phpSat Nov 05 16:59:42 2005
@@ -48,7 +48,11 @@
 $wgDBuser = $wgDBadminuser;
 $wgDBpassword = $wgDBadminpassword;
 
-$sep = ( DIRECTORY_SEPARATOR == "\\" ) ? ";" : ":";
+if (defined("PATH_SEPARATOR")) {
+$sep = PATH_SEPARATOR;
+} else {
+$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+}
 ini_set( "include_path", "$IP$sep$include_path" );
 
 require_once( "Setup.php" );
diff -ur mediawiki-1.5.2\maintenance\liveCmdLine.inc mediawiki-1.5.
2p\maintenance\liveCmdLine.inc
--- mediawiki-1.5.2\maintenance\liveCmdLine.incSat Nov 20 05:23:52 2004
+++ mediawiki-1.5.2p\maintenance\liveCmdLine.incSat Nov 05 16:59:36 2005
@@ -38,7 +38,11 @@
 $wgDBadminpassword = trim(`wikiadmin_pass`);
 }
 
-$sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
+if (defined("PATH_SEPARATOR")) {
+$sep = PATH_SEPARATOR;
+} else {
+$sep = (DIRECTORY_SEPARATOR == "\\") ? ";" : ":";
+}
 putenv( "wikilang=$lang");
 $newpath = "/home/wikipedia/common/php-new$sep";
 
Comment 7 Brion Vibber 2005-12-31 23:52:13 UTC
Reducing priority; NetWare is not exactly a target OS. :)

Can you check if 1.6 in CVS has already fixed this? I seem to remember changing things.
Comment 8 Brion Vibber 2008-02-12 22:29:56 UTC
Resolving as FIXED, since we use PATH_SEPARATOR and DIRECTORY_SEPARATOR exclusively now, as we no longer support older versions of PHP lacking it.

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


Navigation
Links