Index: trunk/phase3/maintenance/mwdocgen.php |
— | — | @@ -37,9 +37,6 @@ |
38 | 38 | /** Figure out the base directory for MediaWiki location */ |
39 | 39 | $mwPath = dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR; |
40 | 40 | |
41 | | -/** Global variable: temporary directory */ |
42 | | -$tmpPath = '/tmp/'; |
43 | | - |
44 | 41 | /** doxygen binary script */ |
45 | 42 | $doxygenBin = 'doxygen'; |
46 | 43 | |
— | — | @@ -67,6 +64,9 @@ |
68 | 65 | # Functions |
69 | 66 | # |
70 | 67 | |
| 68 | +define( 'MEDIAWIKI', true ); |
| 69 | +require_once( "$mwPath/includes/GlobalFunctions.php" ); |
| 70 | + |
71 | 71 | /** |
72 | 72 | * Read a line from the shell |
73 | 73 | * @param $prompt String |
— | — | @@ -133,7 +133,6 @@ |
134 | 134 | * (LocalSettings.php, AdminSettings.php and .svn directories are always excluded) |
135 | 135 | */ |
136 | 136 | function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath, $currentVersion, $svnstat, $input, $exclude ) { |
137 | | - global $tmpPath; |
138 | 137 | |
139 | 138 | $template = file_get_contents( $doxygenTemplate ); |
140 | 139 | |
— | — | @@ -147,7 +146,7 @@ |
148 | 147 | '{{EXCLUDE}}' => $exclude, |
149 | 148 | ); |
150 | 149 | $tmpCfg = str_replace( array_keys( $replacements ), array_values( $replacements ), $template ); |
151 | | - $tmpFileName = $tmpPath . 'mwdocgen' . rand() . '.tmp'; |
| 150 | + $tmpFileName = tempnam( wfTempDir(), 'mwdocgen-' ); |
152 | 151 | file_put_contents( $tmpFileName , $tmpCfg ) or die( "Could not write doxygen configuration to file $tmpFileName\n" ); |
153 | 152 | |
154 | 153 | return $tmpFileName; |