Kraken\Stream\StreamSeeker::__construct PHP Метод

__construct() публичный Метод

public __construct ( resource $resource, boolean $autoClose = true )
$resource resource
$autoClose boolean
    public function __construct($resource, $autoClose = true)
    {
        if (!is_resource($resource)) {
            throw new InvalidArgumentException('First parameter must be a valid resource.');
        }
        $this->resource = $resource;
        $this->autoClose = $autoClose;
        $this->closing = false;
        if (function_exists('stream_set_blocking')) {
            stream_set_blocking($this->resource, 0);
        }
    }

Usage Example

Пример #1
0
 /**
  * @param resource $resource
  * @param bool $autoClose
  * @throws InvalidArgumentException
  */
 public function __construct($resource, $autoClose = true)
 {
     parent::__construct($resource, $autoClose);
     $this->readable = true;
     $this->writable = true;
     $this->bufferSize = 4096;
 }