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