Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 621
Zeile 103... Zeile 103...
103
     * @param int|resource $fileDescriptor
103
     * @param int|resource $fileDescriptor
104
     */
104
     */
105
    public function isInteractive($fileDescriptor = self::STDOUT): bool
105
    public function isInteractive($fileDescriptor = self::STDOUT): bool
106
    {
106
    {
107
        if (is_resource($fileDescriptor)) {
107
        if (is_resource($fileDescriptor)) {
108
            // These functions require a descriptor that is a real resource, not a numeric ID of it
-
 
109
            if (function_exists('stream_isatty') && @stream_isatty($fileDescriptor)) {
108
            if (function_exists('stream_isatty') && @stream_isatty($fileDescriptor)) {
110
                return true;
109
                return true;
111
            }
110
            }
Zeile 112... Zeile -...
112
 
-
 
113
            // Check if formatted mode is S_IFCHR
111
 
114
            if (function_exists('fstat') && @stream_isatty($fileDescriptor)) {
112
            if (function_exists('fstat')) {
Zeile 115... Zeile 113...
115
                $stat = @fstat(STDOUT);
113
                $stat = @fstat(STDOUT);
116
 
114
 
Zeile 117... Zeile 115...
117
                return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
115
                return $stat && 0020000 === ($stat['mode'] & 0170000);
118
            }
116
            }