From 547616e96bde70b94a75d57dc917d207a95cda77 Mon Sep 17 00:00:00 2001 From: Rob Bast Date: Mon, 12 Sep 2016 16:08:50 +0200 Subject: [PATCH] tentative fix for #5667 --- src/Composer/XdebugHandler.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/Composer/XdebugHandler.php b/src/Composer/XdebugHandler.php index cdd7e68ec..8e6992a27 100644 --- a/src/Composer/XdebugHandler.php +++ b/src/Composer/XdebugHandler.php @@ -49,6 +49,14 @@ class XdebugHandler public function check() { if (!$this->needsRestart()) { + $iniScanDir = getenv('PHP_INI_SCAN_DIR_OLD'); + + if ($iniScanDir) { + putenv('PHP_INI_SCAN_DIR=' . $iniScanDir); + } else { + putenv('PHP_INI_SCAN_DIR'); + } + return; } @@ -204,6 +212,12 @@ class XdebugHandler if (!file_exists($this->scanDir) && !@mkdir($this->scanDir, 0777)) { return; } + + $iniScanDirEnv = getenv('PHP_INI_SCAN_DIR'); + if ($iniScanDirEnv) { + putenv('PHP_INI_SCAN_DIR_OLD='.$iniScanDirEnv); + } + if (!putenv('PHP_INI_SCAN_DIR='.$this->scanDir)) { return; }