Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F90015
D7762.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
779 B
Referenced Files
None
Subscribers
None
D7762.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
@@ -186,6 +186,29 @@
}
+ /**
+ * Set the value of a specific environmental variable for this command.
+ *
+ * @param string Environmental variable name.
+ * @param string|null New value, or null to remove this variable.
+ * @return this
+ * @task config
+ */
+ public function updateEnv($key, $value) {
+ if (!is_array($this->env)) {
+ $this->env = $_ENV;
+ }
+
+ if ($value === null) {
+ unset($this->env[$key]);
+ } else {
+ $this->env[$key] = $value;
+ }
+
+ return $this;
+ }
+
+
/* -( Interacting With Commands )------------------------------------------ */
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/gp/kc/k2cewmw7sd34d6kk
Default Alt Text
D7762.diff (779 B)
Attached To
Mode
D7762: Add updateEnv() to ExecFuture for adjusting environmental variables
Attached
Detach File
Event Timeline
Log In to Comment