Remove environment variable

This commit is contained in:
Dennis Eichhorn 2016-11-12 21:40:53 +01:00
parent 2ef8358771
commit e605eb3885

View File

@ -55,14 +55,6 @@ class Repository
*/
private $bare = false;
/**
* Env variables.
*
* @var array
* @since 1.0.0
*/
private $envOptions = [];
/**
* Current branch.
*
@ -189,16 +181,7 @@ class Repository
2 => ['pipe', 'w'],
];
if (count($_ENV) === 0) {
$env = null;
foreach ($this->envOptions as $key => $value) {
putenv(sprintf("%s=%s", $key, $value));
}
} else {
$env = array_merge($_ENV, $this->envOptions);
}
$resource = proc_open($cmd, $desc, $pipes, $this->path, $env);
$resource = proc_open($cmd, $desc, $pipes, $this->path, null);
$stdout = stream_get_contents($pipes[1]);
$stderr = stream_get_contents($pipes[2]);
@ -639,22 +622,6 @@ class Repository
return file_get_contents($this->getDirectoryPath() . '/description');
}
/**
* Set environment value.
*
* @param string $key Key
* @param string $value Value
*
* @return void
*
* @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/
public function setEnv(string $key, string $value)
{
$this->envOptions[$key] = $value;
}
/**
* Count files in repository.
*