Bug 24985 use $wgTmpDirectory when available
authorMark A. Hershberger <mah@everybody.org>
Sat, 26 May 2012 03:19:55 +0000 (23:19 -0400)
committerAntoine Musso <hashar@free.fr>
Wed, 13 Jun 2012 19:30:22 +0000 (21:30 +0200)
commit99fdc6e838d4c7f6a7135a06b58d0bb232ca611c
tree98efd3752d262cd0996b5cf44831026c00dc1924
parentbbffc62c58972a34ee617ce135e37ec936272341
Bug 24985 use $wgTmpDirectory when available

We had two way to get a temporary directory:

 - $wgTempDirectory: more or less stable accross sessions
 - wfTempDir(): set through environnement variable and could potentially
   vary from a session to another one thanks to tempnam()

This patch makes wfTempDir() to always use the global $wgTempDirectory
first when it is available. Thus explicitly overriding tempnam() or any
environnement variable such as TMP or TEMP.

Hence, people who don't have access to a system wide directory
specificed by their environnement (such as /tmp) can specify an
alternative straight from the MediaWiki configuration.

The patch remove references to $wgTmpDirectory and replace them with
calls to wfTempDir().  Make wfTempDir() use $wgTmpDirectory first.

The default setting of $wgTmpDirectory was removed in favor of having it
initialized through Setup.php by calling wfTempDir.

Note: this may also address Bug 36475 - Generating thumbnails does not
work when there is no access to /tmp

Change-Id: Ifdc79e9c5d95f978025b237a5eeb95fd75092f46
RELEASE-NOTES-1.20
includes/DefaultSettings.php
includes/GlobalFunctions.php
includes/Setup.php
includes/diff/DifferenceEngine.php
includes/filerepo/backend/TempFSFile.php
includes/objectcache/DBABagOStuff.php
maintenance/storage/checkStorage.php