ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
StreamingFile.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Sabre\DAV\Mock;
4 
15 class StreamingFile extends File {
16 
17  protected $size;
18 
39  function put($data) {
40 
41  if (is_string($data)) {
42  $stream = fopen('php://memory', 'r+');
43  fwrite($stream, $data);
44  rewind($stream);
45  $data = $stream;
46  }
47  $this->contents = $data;
48 
49  }
50 
58  function get() {
59 
60  return $this->contents;
61 
62  }
63 
73  function getETag() {
74 
75  return null;
76 
77  }
78 
84  function getSize() {
85 
86  return $this->size;
87 
88  }
89 
96  function setSize($size) {
97 
98  $this->size = $size;
99 
100  }
101 
102 }
setSize($size)
Allows testing scripts to set the resource&#39;s file size.
getETag()
Returns the ETag for a file.
$stream
PHP stream implementation.
font size
Definition: langcheck.php:162
put($data)
Updates the data.
getSize()
Returns the size of the node, in bytes.
Mock Streaming File File.
$data
Definition: bench.php:6