fluent-cart
/
vendor
/
openspout
/
openspout
/
src
/
Common
/
Helper
/
FileSystemHelperInterface.php
FileSystemHelperInterface.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.5.1, at vendor/openspout/openspout/src/Common/Helper/FileSystemHelperInterface.php
| 1 | <?php |
| 2 | |
| 3 | namespace FluentCart\OpenSpout\Common\Helper; |
| 4 | |
| 5 | /** |
| 6 | * This interface describes helper functions to help with the file system operations |
| 7 | * like files/folders creation & deletion. |
| 8 | */ |
| 9 | interface FileSystemHelperInterface |
| 10 | { |
| 11 | /** |
| 12 | * Creates an empty folder with the given name under the given parent folder. |
| 13 | * |
| 14 | * @param string $parentFolderPath The parent folder path under which the folder is going to be created |
| 15 | * @param string $folderName The name of the folder to create |
| 16 | * |
| 17 | * @throws \OpenSpout\Common\Exception\IOException If unable to create the folder or if the folder path is not inside of the base folder |
| 18 | * |
| 19 | * @return string Path of the created folder |
| 20 | */ |
| 21 | public function createFolder($parentFolderPath, $folderName); |
| 22 | /** |
| 23 | * Creates a file with the given name and content in the given folder. |
| 24 | * The parent folder must exist. |
| 25 | * |
| 26 | * @param string $parentFolderPath The parent folder path where the file is going to be created |
| 27 | * @param string $fileName The name of the file to create |
| 28 | * @param string $fileContents The contents of the file to create |
| 29 | * |
| 30 | * @throws \OpenSpout\Common\Exception\IOException If unable to create the file or if the file path is not inside of the base folder |
| 31 | * |
| 32 | * @return string Path of the created file |
| 33 | */ |
| 34 | public function createFileWithContents($parentFolderPath, $fileName, $fileContents); |
| 35 | /** |
| 36 | * Delete the file at the given path. |
| 37 | * |
| 38 | * @param string $filePath Path of the file to delete |
| 39 | * |
| 40 | * @throws \OpenSpout\Common\Exception\IOException If the file path is not inside of the base folder |
| 41 | */ |
| 42 | public function deleteFile($filePath); |
| 43 | /** |
| 44 | * Delete the folder at the given path as well as all its contents. |
| 45 | * |
| 46 | * @param string $folderPath Path of the folder to delete |
| 47 | * |
| 48 | * @throws \OpenSpout\Common\Exception\IOException If the folder path is not inside of the base folder |
| 49 | */ |
| 50 | public function deleteFolderRecursively($folderPath); |
| 51 | } |
| 52 |