[Agavi-Tickets] [Agavi] #1437: Automatically read from STDIN in AgaviConsoleRequest

3 views
Skip to first unread message

Agavi

unread,
Nov 9, 2011, 7:22:36 AM11/9/11
to tic...@lists.agavi.org
#1437: Automatically read from STDIN in AgaviConsoleRequest
-------------------------+--------------------------------------------------
Reporter: david | Owner: david
Type: enhancement | Status: new
Priority: normal | Milestone: 1.1
Component: request | Version:
Severity: normal | Keywords:
Has_patch: 0 |
-------------------------+--------------------------------------------------
We can use {{{posix_isatty(STDIN)}}} to detect whether or not something is
piped into the process - with {{{true}}}, there is no {{{STDIN}}} input,
with {{{false}}}, there is.

That doesn't work on Windows though; it appears that
{{{stream_get_meta_data(STDIN)}}} will report {{{false}}} for "seekable"
if there input (since {{{STDIN}}} does not support seeks), and
{{{true}}} if there is no input. Verified to work on Windows, Mac OS and
Linux.

--
Ticket URL: <http://trac.agavi.org/ticket/1437>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5

_______________________________________________
Agavi Tickets Mailing List
tic...@lists.agavi.org
http://lists.agavi.org/mailman/listinfo/tickets

Agavi

unread,
Nov 9, 2011, 7:30:44 AM11/9/11
to tic...@lists.agavi.org
#1437: Automatically read from STDIN in AgaviConsoleRequest
-------------------------+--------------------------------------------------
Reporter: david | Owner: david
Type: enhancement | Status: new
Priority: normal | Milestone: 1.1
Component: request | Version:
Severity: normal | Keywords:
Has_patch: 0 |
-------------------------+--------------------------------------------------

Comment(by david):

The purpose of this is of course to have have the {{{read_stdin}}} option
default to {{{true}}}, since we can detect situations where there is no
input, so there is no overhead (empty file or w/e) involved.

--
Ticket URL: <http://trac.agavi.org/ticket/1437#comment:1>

Agavi

unread,
Nov 9, 2011, 7:33:40 AM11/9/11
to tic...@lists.agavi.org
#1437: Automatically read from STDIN in AgaviConsoleRequest
-------------------------+--------------------------------------------------
Reporter: david | Owner: david
Type: enhancement | Status: new
Priority: normal | Milestone: 1.1
Component: request | Version:
Severity: normal | Keywords:
Has_patch: 0 |
-------------------------+--------------------------------------------------

Comment(by david):

(In [4841]) comment to explain why stream_set_blocking() is used in
AgaviConsoleRequest, refs #1412, #1437 and #480

--
Ticket URL: <http://trac.agavi.org/ticket/1437#comment:2>

Agavi

unread,
Nov 15, 2011, 8:39:52 AM11/15/11
to tic...@lists.agavi.org
#1437: Automatically read from STDIN in AgaviConsoleRequest
-------------------------+--------------------------------------------------
Reporter: david | Owner: david
Type: enhancement | Status: closed

Priority: normal | Milestone: 1.1
Component: request | Version:
Severity: normal | Resolution: fixed
Keywords: | Has_patch: 0
-------------------------+--------------------------------------------------
Changes (by david):

* status: new => closed
* resolution: => fixed


Comment:

(In [4864]) Automatically read from STDIN in AgaviConsoleRequest, closes
#1437 and refs #1436 and #1412

--
Ticket URL: <http://trac.agavi.org/ticket/1437#comment:3>

Agavi

unread,
Dec 25, 2011, 5:56:14 PM12/25/11
to tic...@lists.agavi.org
#1437: Automatically read from STDIN in AgaviConsoleRequest
-------------------------+--------------------------------------------------
Reporter: david | Owner: david
Type: enhancement | Status: closed

Priority: normal | Milestone: 1.1
Component: request | Version:
Severity: normal | Resolution: fixed
Keywords: | Has_patch: 0
-------------------------+--------------------------------------------------

Comment(by david):

(In [4909]) 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

--
Ticket URL: <http://trac.agavi.org/ticket/1437#comment:4>

Reply all
Reply to author
Forward
0 new messages