PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTTP » HTTP_WebDAV_Client » Bug #2463

stream_write() does not update position

Details

Submitted2004-10-05 15:32 UTC
Fromyangbin at fragnetics dot com
Assignedhholzgra
StatusClosed
PackageHTTP_WebDAV_Client
PHP Version4.3.9
OSGNU/Linux
Roadmaps(Not assigned)

Comments

[2004-10-05 15:32 UTC] yangbin at fragnetics dot com

Description:
------------
Using:
PEAR package HTTP_WebDAV_Client
- v0.9.6
pear/HTTP_WebDAV_Client/Client/Stream.php
- patched to v1.5

Problem:
Successive calls to stream_write() (via e.g. puts()) always writes the data in the same position.

Reproduce code:
---------------
++++++++++++++++
reproduce code
++++++++++++++++

$file = fopen("webdav://someone:pass@webdav.somewhere.com/test", "w");
puts($file, "===================");
puts($file, "test");

+++++++++++++++++++++++++++
patch [in stream_write()]
+++++++++++++++++++++++++++

case 200:
case 201:
case 204:
$this->position += strlen($buffer); // add this line
return $end-$start;

Expected result:
----------------
in [$file]:
===================test

Actual result:
--------------
in [$file]:
test===============