‪TYPO3CMS  ‪main
DriverInterface.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 
26 interface DriverInterface
27 {
31  public function processConfiguration(): void;
32 
36  public function setStorageUid(int $storageUid): void;
37 
42  public function initialize(): void;
43 
47  public function getCapabilities(): Capabilities;
48 
54  public function mergeConfigurationCapabilities(Capabilities $capabilities): Capabilities;
55 
61  public function hasCapability(int $capability): bool;
62 
70  public function isCaseSensitiveFileSystem(): bool;
71 
80  public function sanitizeFileName(string $fileName, string $charset = ''): string;
81 
90  public function hashIdentifier(string ‪$identifier): string;
91 
97  public function getRootLevelFolder(): string;
98 
104  public function getDefaultFolder(): string;
105 
112  public function getParentFolderIdentifierOfIdentifier(string $fileIdentifier): string;
113 
121  public function getPublicUrl(string ‪$identifier): ?string;
122 
130  public function createFolder(string $newFolderName, string $parentFolderIdentifier = '', bool $recursive = false): string;
131 
139  public function renameFolder(string $folderIdentifier, string $newName): array;
140 
146  public function deleteFolder(string $folderIdentifier, bool $deleteRecursively = false): bool;
147 
153  public function fileExists(string $fileIdentifier): bool;
154 
160  public function folderExists(string $folderIdentifier): bool;
161 
168  public function isFolderEmpty(string $folderIdentifier): bool;
169 
183  public function addFile(string $localFilePath, string $targetFolderIdentifier, string $newFileName = '', bool $removeOriginal = true): string;
184 
192  public function createFile(string $fileName, string $parentFolderIdentifier): string;
193 
204  public function copyFileWithinStorage(string $fileIdentifier, string $targetFolderIdentifier, string $fileName): string;
205 
213  public function renameFile(string $fileIdentifier, string $newName): string;
214 
221  public function replaceFile(string $fileIdentifier, string $localFilePath): bool;
222 
230  public function deleteFile(string $fileIdentifier): bool;
231 
238  public function hash(string $fileIdentifier, string $hashAlgorithm): string;
239 
250  public function moveFileWithinStorage(string $fileIdentifier, string $targetFolderIdentifier, string $newFileName): string;
251 
260  public function moveFolderWithinStorage(string $sourceFolderIdentifier, string $targetFolderIdentifier, string $newFolderName): array;
261 
269  public function copyFolderWithinStorage(string $sourceFolderIdentifier, string $targetFolderIdentifier, string $newFolderName): bool;
270 
279  public function getFileContents(string $fileIdentifier): string;
280 
287  public function setFileContents(string $fileIdentifier, string $contents): int;
288 
295  public function fileExistsInFolder(string $fileName, string $folderIdentifier): bool;
296 
303  public function folderExistsInFolder(string $folderName, string $folderIdentifier): bool;
304 
316  public function getFileForLocalProcessing(string $fileIdentifier, bool $writable = true): string;
317 
325  public function getPermissions(string ‪$identifier): array;
326 
334  public function dumpFileContents(string ‪$identifier): void;
335 
349  public function isWithin(string $folderIdentifier, string ‪$identifier): bool;
350 
359  public function getFileInfoByIdentifier(string $fileIdentifier, array $propertiesToExtract = []): array;
360 
373  public function getFolderInfoByIdentifier(string $folderIdentifier): array;
374 
382  public function getFileInFolder(string $fileName, string $folderIdentifier): string;
383 
399  public function getFilesInFolder(
400  string $folderIdentifier,
401  int $start = 0,
402  int $numberOfItems = 0,
403  bool $recursive = false,
404  array $filenameFilterCallbacks = [],
405  string $sort = '',
406  bool $sortRev = false
407  ): array;
408 
416  public function getFolderInFolder(string $folderName, string $folderIdentifier): string;
417 
434  public function getFoldersInFolder(
435  string $folderIdentifier,
436  int $start = 0,
437  int $numberOfItems = 0,
438  bool $recursive = false,
439  array $folderNameFilterCallbacks = [],
440  string $sort = '',
441  bool $sortRev = false
442  ): array;
443 
451  public function countFilesInFolder(string $folderIdentifier, bool $recursive = false, array $filenameFilterCallbacks = []): int;
452 
460  public function countFoldersInFolder(string $folderIdentifier, bool $recursive = false, array $folderNameFilterCallbacks = []): int;
461 }
‪TYPO3\CMS\Core\Resource\Capabilities
Definition: Capabilities.php:23
‪TYPO3\CMS\Core\Resource\Driver
Definition: AbstractDriver.php:18
‪TYPO3\CMS\Webhooks\Message\$identifier
‪identifier readonly string $identifier
Definition: FileAddedMessage.php:37