JBZoo\Utils\Cli::isInteractive PHP 메소드

isInteractive() 공개 정적인 메소드

Returns if the file descriptor is an interactive terminal or not.
public static isInteractive ( integer | resource $fileDescriptor = self::STDOUT ) : boolean
$fileDescriptor integer | resource
리턴 boolean
    public static function isInteractive($fileDescriptor = self::STDOUT)
    {
        return function_exists('posix_isatty') && @posix_isatty($fileDescriptor);
    }

Usage Example

예제 #1
0
파일: CliTest.php 프로젝트: jbzoo/utils
 /**
  * @covers \JBZoo\Utils\Cli::isInteractive
  */
 public function testCanDetectIfFileDescriptorIsInteractive()
 {
     $this->assertInternalType('boolean', Cli::isInteractive(STDOUT));
 }