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:
parent
44ff800dd6
commit
7f25138180
@ -303,4 +303,14 @@ class AbstractEntityBodyDecorator implements EntityBodyInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the wrapped EntityBody object
|
||||
*
|
||||
* @return EntityBodyInterface
|
||||
*/
|
||||
public function getDecoratedBody()
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
}
|
||||
|
@ -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'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user