ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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
$type
setVisibility($path, $visibility)
Set the visibility for a file.array|false file meta data
getSize($path)
Get the size of a file.array|false
Definition: NullAdapter.php:92
getVisibility($path)
Get the visibility of a file.array|false
getMetadata($path)
Get all the meta data of a file or directory.array|false
Definition: NullAdapter.php:84
has($path)
Check whether a file is present.
Definition: NullAdapter.php:21
getMimetype($path)
Get the mimetype of a file.array|false
update($path, $contents, Config $config)
Update a file.Config objectarray|false false on failure file meta data on success ...
Definition: NullAdapter.php:44
rename($path, $newpath)
Rename a file.bool
Definition: NullAdapter.php:60
deleteDir($dirname)
Delete a directory.bool
createDir($dirname, Config $config)
Create a directory.directory name array|false
listContents($directory='', $recursive=false)
List contents of a directory.array
Definition: NullAdapter.php:76
getTimestamp($path)
Get the timestamp of a file.array|false
read($path)
Read a file.array|false
Definition: NullAdapter.php:52
write($path, $contents, Config $config)
Write a new file.Config objectarray|false false on failure file meta data on success ...
Definition: NullAdapter.php:29
get($key, $default=null)
Get a setting.
Definition: Config.php:35