Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F82345
D7396.id16688.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7396.id16688.diff
View Options
diff --git a/src/future/exec/ExecFuture.php b/src/future/exec/ExecFuture.php
--- a/src/future/exec/ExecFuture.php
+++ b/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 = array_merge($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
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/zl/al/a5vvhkyfozqezrmy
Default Alt Text
D7396.id16688.diff (1 KB)
Attached To
Mode
D7396: Implement `setEnv`.
Attached
Detach File
Event Timeline
Log In to Comment