Phly\Http\Stream::detach PHP Метод

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

public detach ( )
    public function detach()
    {
        $resource = $this->resource;
        $this->resource = null;
        return $resource;
    }

Usage Example

Пример #1
0
 public function testReadRaisesExceptionWhenStreamIsDetached()
 {
     $this->tmpnam = tempnam(sys_get_temp_dir(), 'phly');
     file_put_contents($this->tmpnam, 'FOO BAR');
     $resource = fopen($this->tmpnam, 'r');
     $stream = new Stream($resource);
     $stream->detach();
     $this->setExpectedException('RuntimeException', 'No resource');
     $stream->read(4096);
 }
All Usage Examples Of Phly\Http\Stream::detach