Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F4080107
D36.id90.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
D36.id90.diff
View Options
diff --git a/files/usr/local/lib/php-fpm-env/PhpFpmEnvironment.php b/files/usr/local/lib/php-fpm-env/PhpFpmEnvironment.php
--- a/files/usr/local/lib/php-fpm-env/PhpFpmEnvironment.php
+++ b/files/usr/local/lib/php-fpm-env/PhpFpmEnvironment.php
@@ -38,19 +38,45 @@
$variables = [];
foreach ($_ENV as $key => $value) {
- if (static::mustIgnoreVariable($key)) {
- continue;
+ if (!static::mustIgnoreVariable($key)) {
+ $variables[$key] = $value;
}
-
- $variables[$key] = $value;
}
- $variables['PATH'] = static::PATH;
+ static::addHardcodedEnvironmentVariables($variables);
+
+ return $variables;
+ }
+
+ /**
+ * Adds hardcoded and always wanted environment variables
+ * (path, temporary directory) to the specified array.
+ *
+ * @paran array $variables the array to add the variables to
+ */
+ public static function addHardcodedEnvironmentVariables (&$variables) {
+ static::addTempEnvironmentVariables ($variables);
+ static::addPathEnvironmentVariables ($variables);
+ }
+
+ /**
+ * Adds temporary directory environment variables to the specified array.
+ *
+ * @paran array $variables the array to add the variables to
+ */
+ public static function addTempEnvironmentVariables (&$variables) {
$variables['TMP'] = static::TMP;
$variables['TEMP'] = static::TMP;
$variables['TMPDIR'] = static::TMP;
+ }
- return $variables;
+ /**
+ * Adds temporary directory environment variables to the specified array.
+ *
+ * @paran array $variables the array to add the variables to
+ */
+ public static function addPathEnvironmentVariables (&$variables) {
+ $variables['PATH'] = static::PATH;
}
/**
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 1, 15:04 (2 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2389913
Default Alt Text
D36.id90.diff (1 KB)
Attached To
Mode
D36: PhpFpmEnvironment::getEnvironmentVariables refactoring
Attached
Detach File
Event Timeline
Log In to Comment