[Agavi-Commits] r4909 - trunk/src/request

0 views
Skip to first unread message

com...@lists.agavi.org

unread,
Dec 25, 2011, 5:56:14 PM12/25/11
to com...@lists.agavi.org
Author: david
Date: 2011-12-25 23:56:12 +0100 (Sun, 25 Dec 2011)
New Revision: 4909

Modified:
trunk/src/request/AgaviConsoleRequest.class.php
Log:
Make sure STDIN is defined before attempting to read it (it is not available when the PHP script itself is read via STDIN, which is how PHPUnit runs isolated tests), refs #1437

Modified: trunk/src/request/AgaviConsoleRequest.class.php
===================================================================
--- trunk/src/request/AgaviConsoleRequest.class.php 2011-12-25 20:26:43 UTC (rev 4908)
+++ trunk/src/request/AgaviConsoleRequest.class.php 2011-12-25 22:56:12 UTC (rev 4909)
@@ -82,7 +82,7 @@
}

$files = array();
- if($this->getParameter('read_stdin', true) && ($stdinMeta = stream_get_meta_data(STDIN)) && !$stdinMeta['seekable']) {
+ if($this->getParameter('read_stdin', true) && defined('STDIN') && ($stdinMeta = stream_get_meta_data(STDIN)) && !$stdinMeta['seekable']) {
// if stream_get_meta_data() reports STDIN as not seekable, that means something was piped into our process, and we should put that into a file
// the alternative method to determine this is via posix_isatty(STDIN) which returns false in the same situation, but that requires the posix extension and also doesn't work on Windows
$stdinName = $this->getParameter('stdin_file_name', 'stdin_file');


_______________________________________________
Agavi Commits Mailing List
com...@lists.agavi.org
http://lists.agavi.org/mailman/listinfo/commits

Reply all
Reply to author
Forward
0 new messages