From: Gunnar Wrobel
Date: Sat, 2 Oct 2010 22:29:01 +0000 (+0200)
Subject: Resolve circular dependency between Support and Stream_Wrapper.
X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ead16a78c93cf7222e40729deb65304be2209802;p=horde.git
Resolve circular dependency between Support and Stream_Wrapper.
---
diff --git a/framework/Stream_Wrapper/lib/Horde/Stream/Wrapper/Combine.php b/framework/Stream_Wrapper/lib/Horde/Stream/Wrapper/Combine.php
index 658ab9210..edcddbcf5 100644
--- a/framework/Stream_Wrapper/lib/Horde/Stream/Wrapper/Combine.php
+++ b/framework/Stream_Wrapper/lib/Horde/Stream/Wrapper/Combine.php
@@ -75,8 +75,8 @@ class Horde_Stream_Wrapper_Combine
{
$opts = stream_context_get_options($this->context);
if (empty($opts['horde-combine']['data']) ||
- !($opts['horde-combine']['data'] instanceof Horde_Support_CombineStream)) {
- throw new Exception('A combined stream must be created using the Horde_Support_CombineStream class.');
+ !($opts['horde-combine']['data'] instanceof Horde_Stream_Wrapper_CombineStream)) {
+ throw new Exception('A combined stream must be created using the Horde_Stream_Wrapper_CombineStream interface.');
}
$data = $opts['horde-combine']['data']->getData();
diff --git a/framework/Stream_Wrapper/lib/Horde/Stream/Wrapper/CombineStream.php b/framework/Stream_Wrapper/lib/Horde/Stream/Wrapper/CombineStream.php
new file mode 100644
index 000000000..758ddc245
--- /dev/null
+++ b/framework/Stream_Wrapper/lib/Horde/Stream/Wrapper/CombineStream.php
@@ -0,0 +1,27 @@
+
+ * @license http://opensource.org/licenses/bsd-license.php BSD
+ * @category Horde
+ * @package Horde_Support
+ */
+
+/**
+ * @author Michael Slusarz
+ * @license http://opensource.org/licenses/bsd-license.php BSD
+ * @category Horde
+ * @package Horde_Support
+ */
+interface Horde_Stream_Wrapper_CombineStream
+{
+ /**
+ * Return a reference to the data.
+ *
+ * @return array
+ */
+ public function getData();
+}
\ No newline at end of file
diff --git a/framework/Stream_Wrapper/lib/Horde/Stream/Wrapper/String.php b/framework/Stream_Wrapper/lib/Horde/Stream/Wrapper/String.php
index 12b06a951..d9f367290 100644
--- a/framework/Stream_Wrapper/lib/Horde/Stream/Wrapper/String.php
+++ b/framework/Stream_Wrapper/lib/Horde/Stream/Wrapper/String.php
@@ -45,8 +45,8 @@ class Horde_Stream_Wrapper_String
public function stream_open($path, $mode, $options, &$opened_path)
{
$options = stream_context_get_options($this->context);
- if (empty($options['horde-string']['string']) || ! $options['horde-string']['string'] instanceof Horde_Support_StringStream) {
- throw new Exception('String streams must be created using the Horde_Support_StringStream class');
+ if (empty($options['horde-string']['string']) || ! $options['horde-string']['string'] instanceof Horde_Stream_Wrapper_StringStream) {
+ throw new Exception('String streams must be created using the Horde_Stream_Wrapper_StringStream interface');
}
$this->_string =& $options['horde-string']['string']->getString();
diff --git a/framework/Stream_Wrapper/lib/Horde/Stream/Wrapper/StringStream.php b/framework/Stream_Wrapper/lib/Horde/Stream/Wrapper/StringStream.php
new file mode 100644
index 000000000..db9afb2b2
--- /dev/null
+++ b/framework/Stream_Wrapper/lib/Horde/Stream/Wrapper/StringStream.php
@@ -0,0 +1,25 @@
+
+ * @license http://opensource.org/licenses/bsd-license.php BSD
+ * @category Horde
+ * @package Horde_Support
+ */
+
+/**
+ * @author Chuck Hagenbuch
+ * @license http://opensource.org/licenses/bsd-license.php BSD
+ * @category Horde
+ * @package Horde_Support
+ */
+interface Horde_Stream_Wrapper_StringStream
+{
+ /**
+ * Return a reference to the wrapped string.
+ *
+ * @return string
+ */
+ public function &getString();
+}
\ No newline at end of file
diff --git a/framework/Stream_Wrapper/package.xml b/framework/Stream_Wrapper/package.xml
index 32f4325a2..82185ddd5 100644
--- a/framework/Stream_Wrapper/package.xml
+++ b/framework/Stream_Wrapper/package.xml
@@ -46,7 +46,9 @@ http://pear.php.net/dtd/package-2.0.xsd">
+
+
@@ -61,16 +63,14 @@ http://pear.php.net/dtd/package-2.0.xsd">
1.7.0
-
- Support
- pear.horde.org
-
+
+
diff --git a/framework/Support/lib/Horde/Support/CombineStream.php b/framework/Support/lib/Horde/Support/CombineStream.php
index 0a3950043..a0c095b79 100644
--- a/framework/Support/lib/Horde/Support/CombineStream.php
+++ b/framework/Support/lib/Horde/Support/CombineStream.php
@@ -16,7 +16,7 @@
* @category Horde
* @package Horde_Support
*/
-class Horde_Support_CombineStream
+class Horde_Support_CombineStream implements Horde_Stream_Wrapper_CombineStream
{
/**
* Data.
diff --git a/framework/Support/lib/Horde/Support/StringStream.php b/framework/Support/lib/Horde/Support/StringStream.php
index afdd678c1..ea573f64a 100644
--- a/framework/Support/lib/Horde/Support/StringStream.php
+++ b/framework/Support/lib/Horde/Support/StringStream.php
@@ -14,7 +14,7 @@
* @category Horde
* @package Horde_Support
*/
-class Horde_Support_StringStream
+class Horde_Support_StringStream implements Horde_Stream_Wrapper_StringStream
{
/**
* @var string