Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15392309
D7762.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
803 B
Referenced Files
None
Subscribers
None
D7762.id.diff
View Options
Index: src/future/exec/ExecFuture.php
===================================================================
--- src/future/exec/ExecFuture.php
+++ 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/plain
Expires
Sun, Mar 16, 2:26 PM (4 d, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7706969
Default Alt Text
D7762.id.diff (803 B)
Attached To
Mode
D7762: Add updateEnv() to ExecFuture for adjusting environmental variables
Attached
Detach File
Event Timeline
Log In to Comment