1
0
Fork 0

Code review fix and doc comment tweaks

pull/5580/head
johnstevenson 2016-09-05 20:19:12 +01:00
parent e381abeec0
commit 4249bd1456
1 changed files with 9 additions and 7 deletions

View File

@ -30,8 +30,8 @@ class XdebugHandler
{ {
$this->loaded = extension_loaded('xdebug'); $this->loaded = extension_loaded('xdebug');
$tmp = sys_get_temp_dir(); $tmp = sys_get_temp_dir();
$this->tmpIni = $tmp.DIRECTORY_SEPARATOR.'composer-php.ini'; $this->tmpIni = $tmp.'/composer-php.ini';
$this->scanDir = $tmp.DIRECTORY_SEPARATOR.'composer-php-empty'; $this->scanDir = $tmp.'/composer-php-empty';
} }
/** /**
@ -134,7 +134,7 @@ class XdebugHandler
} }
/** /**
* Return true if additional inis were loaded * Returns true if additional inis were loaded
* *
* @param array $iniFiles Populated by method * @param array $iniFiles Populated by method
* @param bool $replace Whether we need to modify the files * @param bool $replace Whether we need to modify the files
@ -188,11 +188,11 @@ class XdebugHandler
} }
/** /**
* Returns the command line to restart composer * Creates the required environment and returns the restart command line
* *
* @param bool $additional Whether additional inis were loaded * @param bool $additional Whether additional inis were loaded
* *
* @return string The command line * @return string|null The command line or null on failure
*/ */
private function getCommand($additional) private function getCommand($additional)
{ {
@ -200,7 +200,9 @@ class XdebugHandler
if (!file_exists($this->scanDir) && !@mkdir($this->scanDir, 0777)) { if (!file_exists($this->scanDir) && !@mkdir($this->scanDir, 0777)) {
return; return;
} }
putenv('PHP_INI_SCAN_DIR='.$this->scanDir); if (!putenv('PHP_INI_SCAN_DIR='.$this->scanDir)) {
return;
}
} }
$phpArgs = array(PHP_BINARY, '-c', $this->tmpIni); $phpArgs = array(PHP_BINARY, '-c', $this->tmpIni);