Hello community,
here is the log from the commit of package php5-pear-Horde_Stream_Wrapper for
openSUSE:Factory checked in at 2015-01-20 19:03:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/php5-pear-Horde_Stream_Wrapper (Old)
and /work/SRC/openSUSE:Factory/.php5-pear-Horde_Stream_Wrapper.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "php5-pear-Horde_Stream_Wrapper"
Changes:
--------
---
/work/SRC/openSUSE:Factory/php5-pear-Horde_Stream_Wrapper/php5-pear-Horde_Stream_Wrapper.changes
2012-11-28 14:55:01.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.php5-pear-Horde_Stream_Wrapper.new/php5-pear-Horde_Stream_Wrapper.changes
2015-01-20 19:03:24.000000000 +0100
@@ -1,0 +2,22 @@
+Sun Jan 18 11:43:11 UTC 2015 - Ralf Lang <[email protected]>
+
+- Version 2.1.1
+
+- [jan] Improve PSR-2 compatibility.
+
+-------------------------------------------------------------------
+Wed Feb 19 11:08:20 UTC 2014 - <[email protected]>
+
+- Version 2.1.0
+- [mms] Add unit tests.
+- [mms] Add Horde_Stream_Wrapper_Combine::getStream().
+- [mms] Add Horde_Stream_Wrapper_String::getStream().
+- [mms] Fix documentation regarding proper license for this package (BSD).
+
+-------------------------------------------------------------------
+Wed Jan 9 17:14:25 UTC 2013 - Ralf Lang <[email protected]>
+
+- Version 2.0.1
+- [jan] Re-packaged 2.0.0 release.
+
+-------------------------------------------------------------------
Old:
----
Horde_Stream_Wrapper-2.0.0.tgz
New:
----
Horde_Stream_Wrapper-2.1.1.tgz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ php5-pear-Horde_Stream_Wrapper.spec ++++++
--- /var/tmp/diff_new_pack.180IzQ/_old 2015-01-20 19:03:25.000000000 +0100
+++ /var/tmp/diff_new_pack.180IzQ/_new 2015-01-20 19:03:25.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package php5-pear-Horde_Stream_Wrapper
#
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
Group: Development/Libraries/PHP
Name: php5-pear-Horde_Stream_Wrapper
-Version: 2.0.0
+Version: 2.1.1
Release: 0
Source0: http://pear.horde.org/get/Horde_Stream_Wrapper-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
++++++ Horde_Stream_Wrapper-2.0.0.tgz -> Horde_Stream_Wrapper-2.1.1.tgz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Horde_Stream_Wrapper-2.1.1/doc/Horde/Stream/Wrapper/COPYING
new/Horde_Stream_Wrapper-2.1.1/doc/Horde/Stream/Wrapper/COPYING
--- old/Horde_Stream_Wrapper-2.1.1/doc/Horde/Stream/Wrapper/COPYING
1970-01-01 01:00:00.000000000 +0100
+++ new/Horde_Stream_Wrapper-2.1.1/doc/Horde/Stream/Wrapper/COPYING
2015-01-09 12:50:22.000000000 +0100
@@ -0,0 +1,24 @@
+ Copyright 1999-2015 Horde LLC. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HORDE PROJECT
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/Combine.php
new/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/Combine.php
--- old/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/Combine.php
1970-01-01 01:00:00.000000000 +0100
+++ new/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/Combine.php
2015-01-09 12:50:22.000000000 +0100
@@ -0,0 +1,309 @@
+<?php
+/**
+ * Copyright 2009-2015 Horde LLC (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (BSD). If you
+ * did not receive this file, see http://www.horde.org/licenses/bsd.
+ *
+ * @category Horde
+ * @copyright 2009-2015 Horde LLC
+ * @license http://www.horde.org/licenses/bsd BSD
+ * @package Stream_Wrapper
+ */
+
+/**
+ * A stream wrapper that will combine multiple strings/streams into a single
+ * stream.
+ *
+ * @author Michael Slusarz <[email protected]>
+ * @category Horde
+ * @copyright 2009-2015 Horde LLC
+ * @license http://www.horde.org/licenses/bsd BSD
+ * @package Stream_Wrapper
+ */
+class Horde_Stream_Wrapper_Combine
+{
+ /**/
+ const WRAPPER_NAME = 'horde-stream-wrapper-combine';
+
+ /**
+ * Context.
+ *
+ * @var resource
+ */
+ public $context;
+
+ /**
+ * Array that holds the various streams.
+ *
+ * @var array
+ */
+ protected $_data = array();
+
+ /**
+ * The combined length of the stream.
+ *
+ * @var integer
+ */
+ protected $_length = 0;
+
+ /**
+ * The current position in the string.
+ *
+ * @var integer
+ */
+ protected $_position = 0;
+
+ /**
+ * The current position in the data array.
+ *
+ * @var integer
+ */
+ protected $_datapos = 0;
+
+ /**
+ * Have we reached EOF?
+ *
+ * @var boolean
+ */
+ protected $_ateof = false;
+
+ /**
+ * Unique ID tracker for the streams.
+ *
+ * @var integer
+ */
+ private static $_id = 0;
+
+ /**
+ * Create a stream from multiple data sources.
+ *
+ * @since 2.1.0
+ *
+ * @param array $data An array of strings and/or streams to combine into
+ * a single stream.
+ *
+ * @return resource A PHP stream.
+ */
+ public static function getStream($data)
+ {
+ if (!self::$_id) {
+ stream_wrapper_register(self::WRAPPER_NAME, __CLASS__);
+ }
+
+ return fopen(
+ self::WRAPPER_NAME . '://' . ++self::$_id,
+ 'wb',
+ false,
+ stream_context_create(array(
+ self::WRAPPER_NAME => array(
+ 'data' => $data
+ )
+ ))
+ );
+ }
+ /**
+ * @see streamWrapper::stream_open()
+ *
+ * @param string $path
+ * @param string $mode
+ * @param integer $options
+ * @param string &$opened_path
+ *
+ * @throws Exception
+ */
+ public function stream_open($path, $mode, $options, &$opened_path)
+ {
+ $opts = stream_context_get_options($this->context);
+
+ if (isset($opts[self::WRAPPER_NAME]['data'])) {
+ $data = $opts[self::WRAPPER_NAME]['data'];
+ } elseif (isset($opts['horde-combine']['data'])) {
+ // @deprecated
+ $data = $opts['horde-combine']['data']->getData();
+ } else {
+ throw new Exception('Use ' . __CLASS__ . '::getStream() to
initialize the stream.');
+ }
+
+ reset($data);
+ while (list(,$val) = each($data)) {
+ if (is_string($val)) {
+ $fp = fopen('php://temp', 'r+');
+ fwrite($fp, $val);
+ } else {
+ $fp = $val;
+ }
+
+ fseek($fp, 0, SEEK_END);
+ $length = ftell($fp);
+ rewind($fp);
+
+ $this->_data[] = array(
+ 'fp' => $fp,
+ 'l' => $length,
+ 'p' => 0
+ );
+
+ $this->_length += $length;
+ }
+
+ return true;
+ }
+
+ /**
+ * @see streamWrapper::stream_read()
+ *
+ * @param integer $count
+ *
+ * @return mixed
+ */
+ public function stream_read($count)
+ {
+ if ($this->stream_eof()) {
+ return false;
+ }
+
+ $out = '';
+
+ while ($count) {
+ $tmp = &$this->_data[$this->_datapos];
+ $curr_read = min($count, $tmp['l'] - $tmp['p']);
+ $out .= fread($tmp['fp'], $curr_read);
+ $count -= $curr_read;
+ $this->_position += $curr_read;
+
+ if ($this->_position == $this->_length) {
+ if ($count) {
+ $this->_ateof = true;
+ break;
+ } else {
+ $tmp['p'] += $curr_read;
+ }
+ } elseif ($count) {
+ $tmp = &$this->_data[++$this->_datapos];
+ rewind($tmp['fp']);
+ $tmp['p'] = 0;
+ } else {
+ $tmp['p'] += $curr_read;
+ }
+ }
+
+ return $out;
+ }
+
+ /**
+ * @see streamWrapper::stream_write()
+ *
+ * @param string $data
+ *
+ * @return integer
+ */
+ public function stream_write($data)
+ {
+ $tmp = &$this->_data[$this->_datapos];
+
+ $oldlen = $tmp['l'];
+ $res = fwrite($tmp['fp'], $data);
+ if ($res === false) {
+ return false;
+ }
+
+ $tmp['p'] = ftell($tmp['fp']);
+ if ($tmp['p'] > $oldlen) {
+ $tmp['l'] = $tmp['p'];
+ $this->_length += ($tmp['l'] - $oldlen);
+ }
+
+ return $res;
+ }
+
+ /**
+ * @see streamWrapper::stream_tell()
+ *
+ * @return integer
+ */
+ public function stream_tell()
+ {
+ return $this->_position;
+ }
+
+ /**
+ * @see streamWrapper::stream_eof()
+ *
+ * @return boolean
+ */
+ public function stream_eof()
+ {
+ return $this->_ateof;
+ }
+
+ /**
+ * @see streamWrapper::stream_stat()
+ *
+ * @return array
+ */
+ public function stream_stat()
+ {
+ return array(
+ 'dev' => 0,
+ 'ino' => 0,
+ 'mode' => 0,
+ 'nlink' => 0,
+ 'uid' => 0,
+ 'gid' => 0,
+ 'rdev' => 0,
+ 'size' => $this->_length,
+ 'atime' => 0,
+ 'mtime' => 0,
+ 'ctime' => 0,
+ 'blksize' => 0,
+ 'blocks' => 0
+ );
+ }
+
+ /**
+ * @see streamWrapper::stream_seek()
+ *
+ * @param integer $offset
+ * @param integer $whence SEEK_SET, SEEK_CUR, or SEEK_END
+ *
+ * @return boolean
+ */
+ public function stream_seek($offset, $whence)
+ {
+ $oldpos = $this->_position;
+ $this->_ateof = false;
+
+ switch ($whence) {
+ case SEEK_SET:
+ $offset = $offset;
+ break;
+
+ case SEEK_CUR:
+ $offset = $this->_position + $offset;
+ break;
+
+ case SEEK_END:
+ $offset = $this->_length + $offset;
+ break;
+
+ default:
+ return false;
+ }
+
+ $count = $this->_position = min($this->_length, $offset);
+
+ foreach ($this->_data as $key => $val) {
+ if ($count < $val['l']) {
+ $this->_datapos = $key;
+ $val['p'] = $count;
+ fseek($val['fp'], $count, SEEK_SET);
+ break;
+ }
+ $count -= $val['l'];
+ }
+
+ return ($oldpos != $this->_position);
+ }
+
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/CombineStream.php
new/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/CombineStream.php
--- old/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/CombineStream.php
1970-01-01 01:00:00.000000000 +0100
+++ new/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/CombineStream.php
2015-01-09 12:50:22.000000000 +0100
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Copyright 2009-2015 Horde LLC (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (BSD). If you
+ * did not receive this file, see http://www.horde.org/licenses/bsd.
+ *
+ * @category Horde
+ * @copyright 2009-2015 Horde LLC
+ * @license http://www.horde.org/licenses/bsd BSD
+ * @package Stream_Wrapper
+ */
+
+/**
+ * Provides access to the CombineStream stream wrapper.
+ *
+ * @author Michael Slusarz <[email protected]>
+ * @category Horde
+ * @deprecated Use Horde_Stream_Wrapper_Combine::getStream()
+ * @copyright 2009-2015 Horde LLC
+ * @license http://www.horde.org/licenses/bsd BSD
+ * @package Stream_Wrapper
+ */
+interface Horde_Stream_Wrapper_CombineStream
+{
+ /**
+ * Return a reference to the data.
+ *
+ * @return array
+ */
+ public function getData();
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/String.php
new/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/String.php
--- old/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/String.php
1970-01-01 01:00:00.000000000 +0100
+++ new/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/String.php
2015-01-09 12:50:22.000000000 +0100
@@ -0,0 +1,211 @@
+<?php
+/**
+ * Copyright 2007-2015 Horde LLC (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (BSD). If you
+ * did not receive this file, see http://www.horde.org/licenses/bsd.
+ *
+ * @category Horde
+ * @copyright 2007-2015 Horde LLC
+ * @license http://www.horde.org/licenses/bsd BSD
+ * @package Stream_Wrapper
+ */
+
+/**
+ * A stream wrapper that will treat a native PHP string as a stream.
+ *
+ * @author Chuck Hagenbuch <[email protected]>
+ * @author Michael Slusarz <[email protected]>
+ * @category Horde
+ * @copyright 2007-2015 Horde LLC
+ * @license http://www.horde.org/licenses/bsd BSD
+ * @package Stream_Wrapper
+ */
+class Horde_Stream_Wrapper_String
+{
+ /**/
+ const WRAPPER_NAME = 'horde-stream-wrapper-string';
+
+ /**
+ * The current context.
+ *
+ * @var resource
+ */
+ public $context;
+
+ /**
+ * String position.
+ *
+ * @var integer
+ */
+ protected $_pos;
+
+ /**
+ * The string.
+ *
+ * @var string
+ */
+ protected $_string;
+
+ /**
+ * Unique ID tracker for the streams.
+ *
+ * @var integer
+ */
+ private static $_id = 0;
+
+ /**
+ * Create a stream from a PHP string.
+ *
+ * @since 2.1.0
+ *
+ * @param string &$string A PHP string variable.
+ *
+ * @return resource A PHP stream pointing to the variable.
+ */
+ public static function getStream(&$string)
+ {
+ if (!self::$_id) {
+ stream_wrapper_register(self::WRAPPER_NAME, __CLASS__);
+ }
+
+ /* Needed to keep reference. */
+ $ob = new stdClass;
+ $ob->string = &$string;
+
+ return fopen(
+ self::WRAPPER_NAME . '://' . ++self::$_id,
+ 'wb',
+ false,
+ stream_context_create(array(
+ self::WRAPPER_NAME => array(
+ 'string' => $ob
+ )
+ ))
+ );
+ }
+
+ /**
+ * @see streamWrapper::stream_open()
+ */
+ public function stream_open($path, $mode, $options, &$opened_path)
+ {
+ $opts = stream_context_get_options($this->context);
+
+ if (isset($opts[self::WRAPPER_NAME]['string'])) {
+ $this->_string =& $opts[self::WRAPPER_NAME]['string']->string;
+ } elseif (isset($opts['horde-string']['string'])) {
+ // @deprecated
+ $this->_string =& $opts['horde-string']['string']->getString();
+ } else {
+ throw new Exception('Use ' . __CLASS__ . '::getStream() to
initialize the stream.');
+ }
+
+ if (is_null($this->_string)) {
+ return false;
+ }
+
+ $this->_pos = 0;
+
+ return true;
+ }
+
+ /**
+ * @see streamWrapper::stream_close()
+ */
+ public function stream_close()
+ {
+ $this->_string = '';
+ $this->_pos = 0;
+ }
+
+ /**
+ * @see streamWrapper::stream_read()
+ */
+ public function stream_read($count)
+ {
+ $curr = $this->_pos;
+ $this->_pos += $count;
+ return substr($this->_string, $curr, $count);
+ }
+
+ /**
+ * @see streamWrapper::stream_write()
+ */
+ public function stream_write($data)
+ {
+ $len = strlen($data);
+
+ $this->_string = substr_replace($this->_string, $data, $this->_pos,
$len);
+ $this->_pos += $len;
+
+ return $len;
+ }
+
+ /**
+ * @see streamWrapper::stream_tell()
+ */
+ public function stream_tell()
+ {
+ return $this->_pos;
+ }
+
+ /**
+ * @see streamWrapper::stream_eof()
+ */
+ public function stream_eof()
+ {
+ return ($this->_pos > strlen($this->_string));
+ }
+
+ /**
+ * @see streamWrapper::stream_stat()
+ */
+ public function stream_stat()
+ {
+ return array(
+ 'dev' => 0,
+ 'ino' => 0,
+ 'mode' => 0,
+ 'nlink' => 0,
+ 'uid' => 0,
+ 'gid' => 0,
+ 'rdev' => 0,
+ 'size' => strlen($this->_string),
+ 'atime' => 0,
+ 'mtime' => 0,
+ 'ctime' => 0,
+ 'blksize' => 0,
+ 'blocks' => 0
+ );
+ }
+
+ /**
+ * @see streamWrapper::stream_seek()
+ */
+ public function stream_seek($offset, $whence)
+ {
+ switch ($whence) {
+ case SEEK_SET:
+ $pos = $offset;
+ break;
+
+ case SEEK_CUR:
+ $pos = $this->_pos + $offset;
+ break;
+
+ case SEEK_END:
+ $pos = strlen($this->_string) + $offset;
+ break;
+ }
+
+ if (($pos < 0) || ($pos > strlen($this->_string))) {
+ return false;
+ }
+
+ $this->_pos = $pos;
+
+ return true;
+ }
+
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/StringStream.php
new/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/StringStream.php
--- old/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/StringStream.php
1970-01-01 01:00:00.000000000 +0100
+++ new/Horde_Stream_Wrapper-2.1.1/lib/Horde/Stream/Wrapper/StringStream.php
2015-01-09 12:50:22.000000000 +0100
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Copyright 2007-2015 Horde LLC (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (BSD). If you
+ * did not receive this file, see http://www.horde.org/licenses/bsd.
+ *
+ * @category Horde
+ * @copyright 2007-2015 Horde LLC
+ * @license http://www.horde.org/licenses/bsd BSD
+ * @package Stream_Wrapper
+ */
+
+/**
+ * Provides access to the StringStream stream wrapper.
+ *
+ * @author Chuck Hagenbuch <[email protected]>
+ * @category Horde
+ * @copyright 2007-2015 Horde LLC
+ * @deprecated Use Horde_Stream_Wrapper_String::getStream()
+ * @license http://www.horde.org/licenses/bsd BSD
+ * @package Stream_Wrapper
+ */
+interface Horde_Stream_Wrapper_StringStream
+{
+ /**
+ * Return a reference to the wrapped string.
+ *
+ * @return string
+ */
+ public function &getString();
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/AllTests.php
new/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/AllTests.php
--- old/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/AllTests.php
1970-01-01 01:00:00.000000000 +0100
+++ new/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/AllTests.php
2015-01-09 12:50:22.000000000 +0100
@@ -0,0 +1,3 @@
+<?php
+require_once 'Horde/Test/AllTests.php';
+Horde_Test_AllTests::init(__FILE__)->run();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/CombineTest.php
new/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/CombineTest.php
--- old/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/CombineTest.php
1970-01-01 01:00:00.000000000 +0100
+++ new/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/CombineTest.php
2015-01-09 12:50:22.000000000 +0100
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Copyright 2009-2015 Horde LLC (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (BSD). If you
+ * did not receive this file, see http://www.horde.org/licenses/bsd.
+ *
+ * @category Horde
+ * @copyright 2009-2015 Horde LLC
+ * @license http://www.horde.org/licenses/bsd BSD
+ * @package Stream_Wrapper
+ * @subpackage UnitTests
+ */
+
+/**
+ * Tests for the Combine wrapper.
+ *
+ * @author Michael Slusarz <[email protected]>
+ * @category Horde
+ * @copyright 2009-2015 Horde LLC
+ * @ignore
+ * @license http://www.horde.org/licenses/bsd BSD
+ * @package Stream_Wrapper
+ * @subpackage UnitTests
+ */
+class Horde_Stream_Wrapper_CombineTest extends PHPUnit_Framework_TestCase
+{
+ public function testUsage()
+ {
+ $fp = fopen('php://temp', 'r+');
+ fwrite($fp, '12345');
+
+ $data = array('ABCDE', $fp, 'fghij');
+
+ $stream = Horde_Stream_Wrapper_Combine::getStream($data);
+
+ $this->assertEquals('ABCDE12345fghij', fread($stream, 1024));
+ $this->assertEquals(true, feof($stream));
+ $this->assertEquals(0, fseek($stream, 0));
+ $this->assertEquals(-1, fseek($stream, 0));
+ $this->assertEquals(0, ftell($stream));
+ $this->assertEquals(0, fseek($stream, 5, SEEK_CUR));
+ $this->assertEquals(5, ftell($stream));
+ $this->assertEquals(10, fwrite($stream, '0000000000'));
+ $this->assertEquals(0, fseek($stream, 0, SEEK_END));
+ $this->assertEquals(20, ftell($stream));
+ $this->assertEquals(false, feof($stream));
+
+ fclose($stream);
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/StringTest.php
new/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/StringTest.php
--- old/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/StringTest.php
1970-01-01 01:00:00.000000000 +0100
+++ new/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/StringTest.php
2015-01-09 12:50:22.000000000 +0100
@@ -0,0 +1,66 @@
+<?php
+/**
+ * Copyright 2008-2015 Horde LLC (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (BSD). If you
+ * did not receive this file, see http://www.horde.org/licenses/bsd.
+ *
+ * @category Horde
+ * @copyright 2008-2015 Horde LLC
+ * @license http://www.horde.org/licenses/bsd BSD
+ * @package Stream_Wrapper
+ * @subpackage UnitTests
+ */
+
+/**
+ * Tests for the String wrapper.
+ *
+ * @author Michael Slusarz <[email protected]>
+ * @category Horde
+ * @copyright 2008-2015 Horde LLC
+ * @ignore
+ * @license http://www.horde.org/licenses/bsd BSD
+ * @package Stream_Wrapper
+ * @subpackage UnitTests
+ */
+class Horde_Stream_Wrapper_StringTest extends PHPUnit_Framework_TestCase
+{
+ public function testUsage()
+ {
+ $string = 'ABCDE12345fghij';
+
+ $stream = Horde_Stream_Wrapper_String::getStream($string);
+
+ $this->assertEquals('ABCDE12345fghij', fread($stream, 1024));
+ $this->assertEquals(true, feof($stream));
+ $this->assertEquals(0, fseek($stream, 0));
+ $this->assertEquals(0, fseek($stream, 0));
+ $this->assertEquals(0, ftell($stream));
+ $this->assertEquals(0, fseek($stream, 5, SEEK_CUR));
+ $this->assertEquals(5, ftell($stream));
+ $this->assertEquals(10, fwrite($stream, '0000000000'));
+ $this->assertEquals(0, fseek($stream, 0, SEEK_END));
+ $this->assertEquals(15, ftell($stream));
+ $this->assertEquals(false, feof($stream));
+
+ fclose($stream);
+ }
+
+ public function testMemoryUsage()
+ {
+ $bytes = 1024 * 1024;
+ $string = str_repeat('*', $bytes);
+ $memoryUsage = memory_get_usage();
+
+ $stream = Horde_Stream_Wrapper_String::getStream($string);
+ $memoryUsage2 = memory_get_usage();
+ $this->assertLessThan($memoryUsage + $bytes, $memoryUsage2);
+
+ while (!feof($stream)) {
+ fread($stream, 1024);
+ }
+ $memoryUsage3 = memory_get_usage();
+ $this->assertLessThan($memoryUsage + $bytes, $memoryUsage3);
+ }
+
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/bootstrap.php
new/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/bootstrap.php
--- old/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/bootstrap.php
1970-01-01 01:00:00.000000000 +0100
+++ new/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/bootstrap.php
2015-01-09 12:50:22.000000000 +0100
@@ -0,0 +1,3 @@
+<?php
+require_once 'Horde/Test/Bootstrap.php';
+Horde_Test_Bootstrap::bootstrap(dirname(__FILE__));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/phpunit.xml
new/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/phpunit.xml
--- old/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/phpunit.xml
1970-01-01 01:00:00.000000000 +0100
+++ new/Horde_Stream_Wrapper-2.1.1/test/Horde/Stream/Wrapper/phpunit.xml
2015-01-09 12:50:22.000000000 +0100
@@ -0,0 +1 @@
+<phpunit bootstrap="bootstrap.php"></phpunit>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/package.xml new/package.xml
--- old/package.xml 2012-10-30 19:52:35.000000000 +0100
+++ new/package.xml 2015-01-09 12:50:22.000000000 +0100
@@ -16,33 +16,40 @@
<email>[email protected]</email>
<active>yes</active>
</lead>
- <date>2012-10-30</date>
- <time>19:52:35</time>
+ <date>2015-01-09</date>
+ <time>12:50:22</time>
<version>
- <release>2.0.0</release>
- <api>1.0.0</api>
+ <release>2.1.1</release>
+ <api>2.1.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
- <license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
+ <license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
-* First stable release for Horde 5.
+* [jan] Improve PSR-2 compatibility.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
- <file baseinstalldir="/" md5sum="321bf41f280cf805086dd5a720b37785"
name="doc/Horde/Stream/Wrapper/COPYING" role="doc" />
- <file baseinstalldir="/" md5sum="8d63dbf2dcf4f8a60a2333acdc697326"
name="lib/Horde/Stream/Wrapper/Combine.php" role="php" />
- <file baseinstalldir="/" md5sum="4df102fd7c4445a7742071441fe79906"
name="lib/Horde/Stream/Wrapper/CombineStream.php" role="php" />
- <file baseinstalldir="/" md5sum="051e2267acceecd3b42245c39b5a212f"
name="lib/Horde/Stream/Wrapper/String.php" role="php" />
- <file baseinstalldir="/" md5sum="2429c4702e29a1f2e2003a724e12e258"
name="lib/Horde/Stream/Wrapper/StringStream.php" role="php" />
+ <file baseinstalldir="/" md5sum="5dee577470a920508ad14b3458db79a5"
name="doc/Horde/Stream/Wrapper/COPYING" role="doc" />
+ <file baseinstalldir="/" md5sum="d75369be53adf2d66638ef99663766b6"
name="lib/Horde/Stream/Wrapper/Combine.php" role="php" />
+ <file baseinstalldir="/" md5sum="8118e5ca9e42f0623f0d5a8bab338068"
name="lib/Horde/Stream/Wrapper/CombineStream.php" role="php" />
+ <file baseinstalldir="/" md5sum="aa0462e7ded3dc82c9ee7141bc054fd5"
name="lib/Horde/Stream/Wrapper/String.php" role="php" />
+ <file baseinstalldir="/" md5sum="de7553d4aa5c98e655721e1c4ecf65e6"
name="lib/Horde/Stream/Wrapper/StringStream.php" role="php" />
+ <file baseinstalldir="/" md5sum="8bc9518b9c0576806c82d9413489d099"
name="test/Horde/Stream/Wrapper/AllTests.php" role="test" />
+ <file baseinstalldir="/" md5sum="0a5018f0726d4673850fece3ad4d72c0"
name="test/Horde/Stream/Wrapper/bootstrap.php" role="test" />
+ <file baseinstalldir="/" md5sum="0d9496c7077973eedd9a9c1582203600"
name="test/Horde/Stream/Wrapper/CombineTest.php" role="test" />
+ <file baseinstalldir="/" md5sum="090ce475b8a9773a240e954334988c75"
name="test/Horde/Stream/Wrapper/phpunit.xml" role="test" />
+ <file baseinstalldir="/" md5sum="86cc18bf41b47cf47e17f5267c64a537"
name="test/Horde/Stream/Wrapper/StringTest.php" role="test" />
</dir>
</contents>
<dependencies>
<required>
<php>
<min>5.3.0</min>
+ <max>6.0.0alpha1</max>
+ <exclude>6.0.0alpha1</exclude>
</php>
<pearinstaller>
<min>1.7.0</min>
@@ -56,6 +63,11 @@
<install as="Horde/Stream/Wrapper/CombineStream.php"
name="lib/Horde/Stream/Wrapper/CombineStream.php" />
<install as="Horde/Stream/Wrapper/String.php"
name="lib/Horde/Stream/Wrapper/String.php" />
<install as="Horde/Stream/Wrapper/StringStream.php"
name="lib/Horde/Stream/Wrapper/StringStream.php" />
+ <install as="Horde/Stream/Wrapper/AllTests.php"
name="test/Horde/Stream/Wrapper/AllTests.php" />
+ <install as="Horde/Stream/Wrapper/bootstrap.php"
name="test/Horde/Stream/Wrapper/bootstrap.php" />
+ <install as="Horde/Stream/Wrapper/CombineTest.php"
name="test/Horde/Stream/Wrapper/CombineTest.php" />
+ <install as="Horde/Stream/Wrapper/phpunit.xml"
name="test/Horde/Stream/Wrapper/phpunit.xml" />
+ <install as="Horde/Stream/Wrapper/StringTest.php"
name="test/Horde/Stream/Wrapper/StringTest.php" />
</filelist>
</phprelease>
<changelog>
@@ -69,7 +81,7 @@
<api>alpha</api>
</stability>
<date>2011-03-08</date>
- <license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
+ <license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
* First alpha release for Horde 4.
</notes>
@@ -84,7 +96,7 @@
<api>beta</api>
</stability>
<date>2011-03-16</date>
- <license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
+ <license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
* First beta release for Horde 4.
</notes>
@@ -99,7 +111,7 @@
<api>beta</api>
</stability>
<date>2011-03-22</date>
- <license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
+ <license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
* First release candidate for Horde 4.
</notes>
@@ -114,7 +126,7 @@
<api>beta</api>
</stability>
<date>2011-03-29</date>
- <license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
+ <license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
* Second release candidate for Horde 4.
</notes>
@@ -129,7 +141,7 @@
<api>stable</api>
</stability>
<date>2011-04-06</date>
- <license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
+ <license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
* First stable release for Horde 4.
</notes>
@@ -144,7 +156,7 @@
<api>stable</api>
</stability>
<date>2012-04-10</date>
- <license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
+ <license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
* [rla] Add license file.
</notes>
@@ -159,7 +171,7 @@
<api>stable</api>
</stability>
<date>2012-07-06</date>
- <license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
+ <license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
* First alpha release for Horde 5.
</notes>
@@ -174,7 +186,7 @@
<api>stable</api>
</stability>
<date>2012-07-19</date>
- <license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
+ <license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
* First beta release for Horde 5.
</notes>
@@ -189,10 +201,58 @@
<api>stable</api>
</stability>
<date>2012-10-30</date>
- <license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
+ <license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
* First stable release for Horde 5.
</notes>
</release>
+ <release>
+ <version>
+ <release>2.0.1</release>
+ <api>1.0.0</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2012-11-22</date>
+ <license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
+ <notes>
+* [jan] Re-packaged 2.0.0 release.
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>2.1.0</release>
+ <api>2.1.0</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2014-02-11</date>
+ <license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
+ <notes>
+* [mms] Add unit tests.
+* [mms] Add Horde_Stream_Wrapper_Combine::getStream().
+* [mms] Add Horde_Stream_Wrapper_String::getStream().
+* [mms] Fix documentation regarding proper license for this package (BSD).
+ </notes>
+ </release>
+ <release>
+ <version>
+ <release>2.1.1</release>
+ <api>2.1.0</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <date>2015-01-09</date>
+ <license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
+ <notes>
+* [jan] Improve PSR-2 compatibility.
+ </notes>
+ </release>
</changelog>
</package>
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]