PHP Класс Box\Spout\Common\Helper\FileSystemHelper

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$baseFolderRealPath Real path of the base folder where all the I/O can occur

Открытые методы

Метод Описание
__construct ( string $baseFolderPath )
createFileWithContents ( string $parentFolderPath, string $fileName, string $fileContents ) : string Creates a file with the given name and content in the given folder.
createFolder ( string $parentFolderPath, string $folderName ) : string Creates an empty folder with the given name under the given parent folder.
deleteFile ( string $filePath ) : void Delete the file at the given path
deleteFolderRecursively ( string $folderPath ) : void Delete the folder at the given path as well as all its contents

Защищенные методы

Метод Описание
throwIfOperationNotInBaseFolder ( string $operationFolderPath ) : void All I/O operations must occur inside the base folder, for security reasons.

Описание методов

__construct() публичный Метод

public __construct ( string $baseFolderPath )
$baseFolderPath string The path of the base folder where all the I/O can occur

createFileWithContents() публичный Метод

The parent folder must exist.
public createFileWithContents ( string $parentFolderPath, string $fileName, string $fileContents ) : string
$parentFolderPath string The parent folder path where the file is going to be created
$fileName string The name of the file to create
$fileContents string The contents of the file to create
Результат string Path of the created file

createFolder() публичный Метод

Creates an empty folder with the given name under the given parent folder.
public createFolder ( string $parentFolderPath, string $folderName ) : string
$parentFolderPath string The parent folder path under which the folder is going to be created
$folderName string The name of the folder to create
Результат string Path of the created folder

deleteFile() публичный Метод

Delete the file at the given path
public deleteFile ( string $filePath ) : void
$filePath string Path of the file to delete
Результат void

deleteFolderRecursively() публичный Метод

Delete the folder at the given path as well as all its contents
public deleteFolderRecursively ( string $folderPath ) : void
$folderPath string Path of the folder to delete
Результат void

throwIfOperationNotInBaseFolder() защищенный Метод

This function will throw an exception if the folder where the I/O operation should occur is not inside the base folder.
protected throwIfOperationNotInBaseFolder ( string $operationFolderPath ) : void
$operationFolderPath string The path of the folder where the I/O operation should occur
Результат void

Описание свойств

$baseFolderRealPath защищенное свойство

Real path of the base folder where all the I/O can occur
protected $baseFolderRealPath