From: Chuck Hagenbuch Date: Wed, 23 Sep 2009 20:32:07 +0000 (-0400) Subject: Add a method for getting an SplFileObject pointing to a Horde_Support_StringStream X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f3fdace10864b64a208e7175c482d4f2d1ce4e8b;p=horde.git Add a method for getting an SplFileObject pointing to a Horde_Support_StringStream --- 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()