Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15380831
D21804.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
D21804.id.diff
View Options
diff --git a/src/utils/PhutilSystem.php b/src/utils/PhutilSystem.php
--- a/src/utils/PhutilSystem.php
+++ b/src/utils/PhutilSystem.php
@@ -17,7 +17,7 @@
*/
public static function getStdinHandle() {
if (self::$stdin === false) {
- self::$stdin = self::newStdioHandle('php://stdin');
+ self::$stdin = self::getStdioHandle('STDIN');
}
return self::$stdin;
@@ -28,7 +28,7 @@
*/
public static function getStdoutHandle() {
if (self::$stdout === false) {
- self::$stdout = self::newStdioHandle('php://stdout');
+ self::$stdout = self::getStdioHandle('STDOUT');
}
return self::$stdout;
@@ -39,7 +39,7 @@
*/
public static function getStderrHandle() {
if (self::$stderr === false) {
- self::$stderr = self::newStdioHandle('php://stderr');
+ self::$stderr = self::getStdioHandle('STDERR');
}
return self::$stderr;
@@ -63,15 +63,12 @@
/**
* @task stdio
*/
- private static function newStdioHandle($ref) {
- $ignored_mode = '';
-
- $handle = @fopen($ref, $ignored_mode);
- if ($handle === false) {
- return null;
+ private static function getStdioHandle($ref) {
+ if (defined($ref)) {
+ return constant($ref);
}
- return $handle;
+ return null;
}
/**
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 15, 4:41 AM (3 d, 16 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7350550
Default Alt Text
D21804.id.diff (1 KB)
Attached To
Mode
D21804: Return STDIN, STDOUT, and STDERR file descriptors from parent process
Attached
Detach File
Event Timeline
Log In to Comment