1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-25 02:22:57 +01:00

Adding the ability to get the decorated entity body of an entitybody decorator. Clearing the stat cache when getting the size of a local stream.

This commit is contained in:
Michael Dowling 2013-04-23 18:02:57 -07:00
parent 44ff800dd6
commit 7f25138180
2 changed files with 11 additions and 0 deletions

View File

@ -303,4 +303,14 @@ class AbstractEntityBodyDecorator implements EntityBodyInterface
return $this;
}
/**
* Get the wrapped EntityBody object
*
* @return EntityBodyInterface
*/
public function getDecoratedBody()
{
return $this->body;
}
}

View File

@ -205,6 +205,7 @@ class Stream implements StreamInterface
// If the stream is a file based stream and local, then use fstat
if ($this->isLocal()) {
clearstatcache(true, $this->getUri());
$stats = fstat($this->stream);
if (isset($stats['size'])) {
return $stats['size'];