Page MenuHomePhabricator

D7396.id.diff
No OneTemporary

D7396.id.diff

Index: src/future/exec/ExecFuture.php
===================================================================
--- src/future/exec/ExecFuture.php
+++ src/future/exec/ExecFuture.php
@@ -36,6 +36,7 @@
protected $stdoutPos = 0;
protected $stderrPos = 0;
protected $command = null;
+ protected $env = null;
protected $cwd;
protected $stdoutSizeLimit = PHP_INT_MAX;
@@ -168,6 +169,23 @@
}
+ /**
+ * Set the environment variables to use when executing the command.
+ *
+ * @param array Environment variables to use when executing the command.
+ * @return this
+ * @task config
+ */
+ public function setEnv($env, $wipe_process_env = false) {
+ if ($wipe_process_env) {
+ $this->env = $env;
+ } else {
+ $this->env = $env + $_ENV;
+ }
+ return $this;
+ }
+
+
/* -( Interacting With Commands )------------------------------------------ */
@@ -522,7 +540,8 @@
$unmasked_command,
self::$descriptorSpec,
$pipes,
- $this->cwd);
+ $this->cwd,
+ $this->env);
if ($trap) {
$err = $trap->getErrorsAsString();

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 19, 5:50 PM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7710116
Default Alt Text
D7396.id.diff (1 KB)

Event Timeline