<?php
/**
- * Zend Framework (http://framework.zend.com/)
- *
- * @see http://github.com/zendframework/zend-diactoros for the canonical source repository
- * @copyright Copyright (c) 2015-2016 Zend Technologies USA Inc. (http://www.zend.com)
+ * @see https://github.com/zendframework/zend-diactoros for the canonical source repository
+ * @copyright Copyright (c) 2015-2017 Zend Technologies USA Inc. (http://www.zend.com)
* @license https://github.com/zendframework/zend-diactoros/blob/master/LICENSE.md New BSD License
*/
}
try {
- $this->rewind();
+ if ($this->isSeekable()) {
+ $this->rewind();
+ }
+
return $this->getContents();
} catch (RuntimeException $e) {
return '';
}
$stats = fstat($this->resource);
- return $stats['size'];
+ if ($stats !== false) {
+ return $stats['size'];
+ }
+
+ return null;
}
/**