From f3fdace10864b64a208e7175c482d4f2d1ce4e8b Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Wed, 23 Sep 2009 16:32:07 -0400 Subject: [PATCH] Add a method for getting an SplFileObject pointing to a Horde_Support_StringStream --- framework/Support/lib/Horde/Support/StringStream.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/framework/Support/lib/Horde/Support/StringStream.php b/framework/Support/lib/Horde/Support/StringStream.php index a4927df92..c89857b53 100644 --- a/framework/Support/lib/Horde/Support/StringStream.php +++ b/framework/Support/lib/Horde/Support/StringStream.php @@ -44,6 +44,17 @@ class Horde_Support_StringStream } /** + * Return an SplFileObject representing this string stream + * + * @return SplFileObject + */ + public function getFileObject() + { + $context = stream_context_create(array('horde-string' => array('string' => $this))); + return new SplFileObject('horde-string://' . spl_object_hash($this), 'rb', false, $context); + } + + /** * Install the horde-string stream wrapper if it isn't already registered. */ public function installWrapper() -- 2.11.0