ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
StreamingFile.php
Go to the documentation of this file.
1<?php
2
3namespace Sabre\DAV\Mock;
4
15class 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}
An exception for terminatinating execution or to throw for unit testing.
File class.
Definition: File.php:15
Mock Streaming File File.
getETag()
Returns the ETag for a file.
getSize()
Returns the size of the node, in bytes.
setSize($size)
Allows testing scripts to set the resource's file size.
put($data)
Updates the data.
font size
Definition: langcheck.php:162
$stream
PHP stream implementation.
$data
Definition: bench.php:6