[DOCS] Remove confusing "cron command" ambiguity.
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Resource / InaccessibleFolder.php
1 <?php
2 namespace TYPO3\CMS\Core\Resource;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * A representation for an inaccessible folder.
19 *
20 * If a folder has execution rights you can list it's contents
21 * despite the access rights on the subfolders. If a subfolder
22 * has no rights it has to be shown anyhow, but marked as
23 * inaccessible.
24 */
25 class InaccessibleFolder extends Folder
26 {
27 /**
28 * Throws an Exception,
29 * used to prevent duplicate code in all the methods
30 *
31 * @throws Exception\InsufficientFolderReadPermissionsException
32 */
33 protected function throwInaccessibleException()
34 {
35 throw new Exception\InsufficientFolderReadPermissionsException(
36 'You are trying to use a method on the inaccessible folder "' . $this->getName() . '".',
37 1390290029
38 );
39 }
40
41 /**
42 * Sets a new name of the folder
43 * currently this does not trigger the "renaming process"
44 * as the name is more seen as a label
45 *
46 * @param string $name The new name
47 */
48 public function setName($name)
49 {
50 $this->throwInaccessibleException();
51 }
52
53 /**
54 * Returns a publicly accessible URL for this folder
55 *
56 * WARNING: Access to the folder may be restricted by further means, e.g. some
57 * web-based authentication. You have to take care of this yourself.
58 *
59 * @param bool $relativeToCurrentScript Determines whether the URL returned should be relative to the current script, in case it is relative at all (only for the LocalDriver)
60 * @return string|null NULL if file is missing or deleted, the generated url otherwise
61 */
62 public function getPublicUrl($relativeToCurrentScript = false)
63 {
64 $this->throwInaccessibleException();
65 }
66
67 /**
68 * Returns a list of files in this folder, optionally filtered. There are several filter modes available, see the
69 * FILTER_MODE_* constants for more information.
70 *
71 * For performance reasons the returned items can also be limited to a given range
72 *
73 * @param int $start The item to start at
74 * @param int $numberOfItems The number of items to return
75 * @param int $filterMode The filter mode to use for the filelist.
76 * @param bool $recursive
77 * @param string $sort
78 * @param bool $sortRev
79 * @throws Exception\InsufficientFolderReadPermissionsException
80 */
81 public function getFiles($start = 0, $numberOfItems = 0, $filterMode = self::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS, $recursive = false, $sort = '', $sortRev = false)
82 {
83 $this->throwInaccessibleException();
84 }
85
86 /**
87 * Returns amount of all files within this folder, optionally filtered by
88 * the given pattern
89 *
90 * @param array $filterMethods
91 * @param bool $recursive
92 * @throws Exception\InsufficientFolderReadPermissionsException
93 */
94 public function getFileCount(array $filterMethods = [], $recursive = false)
95 {
96 $this->throwInaccessibleException();
97 }
98
99 /**
100 * Returns the object for a subfolder of the current folder, if it exists.
101 *
102 * @param string $name Name of the subfolder
103 * @throws Exception\InsufficientFolderReadPermissionsException
104 */
105 public function getSubfolder($name)
106 {
107 $this->throwInaccessibleException();
108 }
109
110 /**
111 * Returns a list of subfolders
112 *
113 * @param int $start The item to start at
114 * @param int $numberOfItems The number of items to return
115 * @param int $filterMode The filter mode to use for the filelist.
116 * @param bool $recursive
117 * @throws Exception\InsufficientFolderReadPermissionsException
118 */
119 public function getSubfolders($start = 0, $numberOfItems = 0, $filterMode = self::FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS, $recursive = false)
120 {
121 $this->throwInaccessibleException();
122 }
123
124 /**
125 * Adds a file from the local server disk. If the file already exists and
126 * overwriting is disabled,
127 *
128 * @param string $localFilePath
129 * @param string $fileName
130 * @param string $conflictMode a value of the DuplicationBehavior enumeration
131 * @throws Exception\InsufficientFolderReadPermissionsException
132 */
133 public function addFile($localFilePath, $fileName = null, $conflictMode = DuplicationBehavior::CANCEL)
134 {
135 $this->throwInaccessibleException();
136 }
137
138 /**
139 * Adds an uploaded file into the Storage.
140 *
141 * @param array $uploadedFileData contains information about the uploaded file given by $_FILES['file1']
142 * @param string $conflictMode a value of the DuplicationBehavior enumeration
143 * @throws Exception\InsufficientFolderReadPermissionsException
144 */
145 public function addUploadedFile(array $uploadedFileData, $conflictMode = DuplicationBehavior::CANCEL)
146 {
147 $this->throwInaccessibleException();
148 }
149
150 /**
151 * Renames this folder.
152 *
153 * @param string $newName
154 * @throws Exception\InsufficientFolderReadPermissionsException
155 */
156 public function rename($newName)
157 {
158 $this->throwInaccessibleException();
159 }
160
161 /**
162 * Deletes this folder from its storage. This also means that this object becomes useless.
163 *
164 * @param bool $deleteRecursively
165 * @throws Exception\InsufficientFolderReadPermissionsException
166 */
167 public function delete($deleteRecursively = true)
168 {
169 $this->throwInaccessibleException();
170 }
171
172 /**
173 * Creates a new blank file
174 *
175 * @param string $fileName
176 * @throws Exception\InsufficientFolderReadPermissionsException
177 */
178 public function createFile($fileName)
179 {
180 $this->throwInaccessibleException();
181 }
182
183 /**
184 * Creates a new folder
185 *
186 * @param string $folderName
187 * @throws Exception\InsufficientFolderReadPermissionsException
188 */
189 public function createFolder($folderName)
190 {
191 $this->throwInaccessibleException();
192 }
193
194 /**
195 * Copies folder to a target folder
196 *
197 * @param Folder $targetFolder Target folder to copy to.
198 * @param string $targetFolderName an optional destination fileName
199 * @param string $conflictMode a value of the DuplicationBehavior enumeration
200 * @throws Exception\InsufficientFolderReadPermissionsException
201 */
202 public function copyTo(Folder $targetFolder, $targetFolderName = null, $conflictMode = DuplicationBehavior::RENAME)
203 {
204 $this->throwInaccessibleException();
205 }
206
207 /**
208 * Moves folder to a target folder
209 *
210 * @param Folder $targetFolder Target folder to move to.
211 * @param string $targetFolderName an optional destination fileName
212 * @param string $conflictMode a value of the DuplicationBehavior enumeration
213 * @throws Exception\InsufficientFolderReadPermissionsException
214 */
215 public function moveTo(Folder $targetFolder, $targetFolderName = null, $conflictMode = DuplicationBehavior::RENAME)
216 {
217 $this->throwInaccessibleException();
218 }
219
220 /**
221 * Checks if a file exists in this folder
222 *
223 * @param string $name
224 * @throws Exception\InsufficientFolderReadPermissionsException
225 */
226 public function hasFile($name)
227 {
228 $this->throwInaccessibleException();
229 }
230
231 /**
232 * Checks if a folder exists in this folder.
233 *
234 * @param string $name
235 * @throws Exception\InsufficientFolderReadPermissionsException
236 */
237 public function hasFolder($name)
238 {
239 $this->throwInaccessibleException();
240 }
241
242 /**
243 * Updates the properties of this folder, e.g. after re-indexing or moving it.
244 *
245 * NOTE: This method should not be called from outside the File Abstraction Layer (FAL)!
246 *
247 * @param array $properties
248 * @internal
249 */
250 public function updateProperties(array $properties)
251 {
252 $this->throwInaccessibleException();
253 }
254
255 /**
256 * Sets the filters to use when listing files. These are only used if the filter mode is one of
257 * FILTER_MODE_USE_OWN_FILTERS and FILTER_MODE_USE_OWN_AND_STORAGE_FILTERS
258 *
259 * @param array $filters
260 */
261 public function setFileAndFolderNameFilters(array $filters)
262 {
263 $this->throwInaccessibleException();
264 }
265
266 /**
267 * @return int
268 */
269 public function getModificationTime()
270 {
271 return 0;
272 }
273
274 /**
275 * @return int
276 */
277 public function getCreationTime()
278 {
279 return 0;
280 }
281 }