ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
NullAdapter.php
Go to the documentation of this file.
1<?php
2
4
8
10{
11 use StreamedTrait;
13
21 public function has($path)
22 {
23 return false;
24 }
25
29 public function write($path, $contents, Config $config)
30 {
31 $type = 'file';
32 $result = compact('contents', 'type', 'path');
33
34 if ($visibility = $config->get('visibility')) {
35 $result['visibility'] = $visibility;
36 }
37
38 return $result;
39 }
40
44 public function update($path, $contents, Config $config)
45 {
46 return false;
47 }
48
52 public function read($path)
53 {
54 return false;
55 }
56
60 public function rename($path, $newpath)
61 {
62 return false;
63 }
64
68 public function delete($path)
69 {
70 return false;
71 }
72
76 public function listContents($directory = '', $recursive = false)
77 {
78 return [];
79 }
80
84 public function getMetadata($path)
85 {
86 return false;
87 }
88
92 public function getSize($path)
93 {
94 return false;
95 }
96
100 public function getMimetype($path)
101 {
102 return false;
103 }
104
108 public function getTimestamp($path)
109 {
110 return false;
111 }
112
116 public function getVisibility($path)
117 {
118 return false;
119 }
120
124 public function setVisibility($path, $visibility)
125 {
126 return compact('visibility');
127 }
128
132 public function createDir($dirname, Config $config)
133 {
134 return ['path' => $dirname, 'type' => 'dir'];
135 }
136
140 public function deleteDir($dirname)
141 {
142 return false;
143 }
144}
$result
$path
Definition: aliased.php:25
An exception for terminatinating execution or to throw for unit testing.
read($path)
Read a file.array|false
Definition: NullAdapter.php:52
rename($path, $newpath)
Rename a file.bool
Definition: NullAdapter.php:60
getTimestamp($path)
Get the timestamp of a file.array|false
getMetadata($path)
Get all the meta data of a file or directory.array|false
Definition: NullAdapter.php:84
setVisibility($path, $visibility)
Set the visibility for a file.array|false file meta data
getMimetype($path)
Get the mimetype of a file.array|false
listContents($directory='', $recursive=false)
List contents of a directory.array
Definition: NullAdapter.php:76
has($path)
Check whether a file is present.
Definition: NullAdapter.php:21
createDir($dirname, Config $config)
Create a directory.array|false
write($path, $contents, Config $config)
Write a new file.array|false false on failure file meta data on success
Definition: NullAdapter.php:29
getVisibility($path)
Get the visibility of a file.array|false
update($path, $contents, Config $config)
Update a file.array|false false on failure file meta data on success
Definition: NullAdapter.php:44
deleteDir($dirname)
Delete a directory.bool
getSize($path)
Get the size of a file.array|false
Definition: NullAdapter.php:92
$config
Definition: bootstrap.php:15
$type