From 73e6441fd964e164492cbb54ebe62d63214886e7 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Fri, 5 May 2017 16:45:53 +0200 Subject: [PATCH] Add getResource() to resource streams --- lib/ResourceInputStream.php | 4 ++++ lib/ResourceOutputStream.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/ResourceInputStream.php b/lib/ResourceInputStream.php index d5df944..72e7c1d 100644 --- a/lib/ResourceInputStream.php +++ b/lib/ResourceInputStream.php @@ -127,6 +127,10 @@ class ResourceInputStream implements InputStream { Loop::cancel($this->watcher); } + public function getResource() { + return $this->resource; + } + public function __destruct() { if ($this->autoClose) { $this->close(); diff --git a/lib/ResourceOutputStream.php b/lib/ResourceOutputStream.php index aaa85fd..ea502d2 100644 --- a/lib/ResourceOutputStream.php +++ b/lib/ResourceOutputStream.php @@ -206,6 +206,10 @@ class ResourceOutputStream implements OutputStream { Loop::cancel($this->watcher); } + public function getResource() { + return $this->resource; + } + public function __destruct() { if ($this->autoClose) { $this->close();