PHP Class Box\Spout\Common\Helper\FileSystemHelper

Afficher le fichier Open project: box/spout Class Usage Examples

Protected Properties

Свойство Type Description
$baseFolderRealPath Real path of the base folder where all the I/O can occur

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
throwIfOperationNotInBaseFolder ( string $operationFolderPath ) : void All I/O operations must occur inside the base folder, for security reasons.

Method Details

__construct() public méthode

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

createFileWithContents() public méthode

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
Résultat string Path of the created file

createFolder() public méthode

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
Résultat string Path of the created folder

deleteFile() public méthode

Delete the file at the given path
public deleteFile ( string $filePath ) : void
$filePath string Path of the file to delete
Résultat void

deleteFolderRecursively() public méthode

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
Résultat void

throwIfOperationNotInBaseFolder() protected méthode

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
Résultat void

Property Details

$baseFolderRealPath protected_oe property

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