Add isPipe(), isRedirection() & co. methods.

Add the getMode($pipe) method, to get the mode of $pipe and returns one
of the following constants: IS_FIFO, IS_CHARACTER, IS_DIRECTORY,
IS_BLOCK, IS_REGULAR, IS_LINK, IS_SOCKET and IS_WHITEOUT.

Add the semantics aliases isDirect($pipe), isPipe($pipe) and
isRedirection($pipe). For example (we focus on a file called Mode.php):

    $ php Mode.php
    // isDirect(STDOUT) is true

    $ php Mode.php | /tmp/foo
    // isPipe(STDOUT) is true

    $ php Mode.php < /tmp/foo
    // isRedirection(STDIN) is true

For more informations, please see the source code of sys/stat.h.

Bonus: it replaces the tricky call to posix_isatty(0).
Support when STDIN is a pipe or a redirection.

Add support when STDIN is direct, not a pipe or a redirection.
Remove the trailing character (on Windows initially, and when STDIN is
not direct).
This function returns false on EOF.
[auto] Merge from Console

    • #c2d7652 — Add isPipe(), isRedirection() & co. methods. (Ivan Enderlin, 2013-02-22)
    • #6115995 — Support when STDIN is a pipe or a redirection. (Ivan Enderlin, 2013-02-22)

---

Merge remote branch 'library-console/master'