Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15407495
D7396.id.diff
No One
Temporary
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.id.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D7396: Implement `setEnv`.
Attached
Detach File
Event Timeline
Log In to Comment