1
0
Fork 0

Fix for a fatal error when system temp dir is not available

pull/5360/head
Metod 2016-05-17 12:06:27 +01:00 committed by Jordi Boggiano
parent c47b302a3c
commit 360cb4ac2a
1 changed files with 1 additions and 1 deletions

View File

@ -188,7 +188,7 @@ class Application extends BaseApplication
} }
// Check system temp folder for usability as it can cause weird runtime issues otherwise // Check system temp folder for usability as it can cause weird runtime issues otherwise
Silencer::call(function() { Silencer::call(function () use ($io) {
$tempfile = sys_get_temp_dir() . '/temp-' . md5(microtime()); $tempfile = sys_get_temp_dir() . '/temp-' . md5(microtime());
if (!(file_put_contents($tempfile, __FILE__) && (file_get_contents($tempfile) == __FILE__) && unlink($tempfile) && !file_exists($tempfile))) { if (!(file_put_contents($tempfile, __FILE__) && (file_get_contents($tempfile) == __FILE__) && unlink($tempfile) && !file_exists($tempfile))) {
$io->writeError(sprintf('<error>PHP temp directory (%s) does not exist or is not writable to Composer. Set sys_temp_dir in your php.ini</error>', sys_get_temp_dir())); $io->writeError(sprintf('<error>PHP temp directory (%s) does not exist or is not writable to Composer. Set sys_temp_dir in your php.ini</error>', sys_get_temp_dir()));