Last modified: 2010-05-15 15:38:24 UTC
The temporary directory in the parsertests is named so that it can only be
created on Unix Systems, but fails on Windows. Attached patch creates a
temporary directory on Windows only using the TMPDIR environment variable.
Created attachment 537 [details]
patch for CVS HEAD
Perhaps it would be cleaner to use TMPDIR if it's set, otherwise default to /tmp.
Is there any particular reason to specially try to detect Windows?
Uuum. I reinvestigated the problem and saw the root cause is completely
different. mkdir() does not create recursive directories. On Windows the /tmp
directory does not exist and therefor the creation of /tmp/mwParser... fails. So
my patch worked with pure luck because on my system the TMPDIR variable is empty.
A better solution might be to simply create the /tmp directory, if it does not
exist. On Windows that will create a sub directory /tmp in the mediawiki
installation directory, if no TMPDIR is set. On my system this solution worked fine.
Err. Another typo. :/
I meant to suggest creating the "tmp" directory, not the "/tmp" directory, e.g.
In general I'd prefer that the parser tests not mess with the file structure inside the wiki's own area.
My XP box has TMP and TEMP environment variables set, but not TMPDIR. TMPDIR seems to be the thing on *nix, though; a
quick check through each? A wfTmpDir() might be in order to encapsulate this... I would have used tmpnam() but that
creates the file, and we want a directory so it's a bit silly.
Added wfTempDir() to check those environment vars; that should do it. Please confirm it actually works on Windows. :)
I can confirm that it works on Windows now. And the group table issue is also
Re-opening, as there is a typo in wfTmpDir() in HEAD, which causes the same
problem to occur if TMPDIR is not set. Patch to follow.
Created attachment 636 [details]
HEAD patch for GlobalFunctions.php