Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
OpenSpout\Writer\XLSX\Helper\FileSystemHelper Class Reference
Inheritance diagram for OpenSpout\Writer\XLSX\Helper\FileSystemHelper:
OpenSpout\Writer\Common\Helper\FileSystemWithRootFolderHelperInterface OpenSpout\Common\Helper\FileSystemHelperInterface

Public Member Functions

 createBaseFilesAndFolders ()
 Creates all the folders needed to create a spreadsheet, as well as the files that won't change.
 
 createFileWithContents (string $parentFolderPath, string $fileName, string $fileContents)
 Creates a file with the given name and content in the given folder.
 
 createFolder (string $parentFolderPath, string $folderName)
 Creates an empty folder with the given name under the given parent folder.
 
 deleteFile (string $filePath)
 Delete the file at the given path.
 
 deleteFolderRecursively (string $folderPath)
 Delete the folder at the given path as well as all its contents.
 
 getRootFolder ()
 
 getSheetsContentTempFolder ()
 

Public Attributes

const APP_XML_FILE_NAME = 'app.xml'
 
const CONTENT_TYPES_XML_FILE_NAME = '[Content_Types].xml'
 
const CORE_XML_FILE_NAME = 'core.xml'
 
const CUSTOM_XML_FILE_NAME = 'custom.xml'
 
const DOC_PROPS_FOLDER_NAME = 'docProps'
 
const DRAWINGS_FOLDER_NAME = 'drawings'
 
const RELS_FILE_NAME = '.rels'
 
const RELS_FOLDER_NAME = '_rels'
 
const STYLES_XML_FILE_NAME = 'styles.xml'
 
const WORKBOOK_RELS_XML_FILE_NAME = 'workbook.xml.rels'
 
const WORKBOOK_XML_FILE_NAME = 'workbook.xml'
 
const WORKSHEETS_FOLDER_NAME = 'worksheets'
 
const XL_FOLDER_NAME = 'xl'
 

Member Function Documentation

◆ createBaseFilesAndFolders()

OpenSpout\Writer\Common\Helper\FileSystemWithRootFolderHelperInterface::createBaseFilesAndFolders ( )
inherited

Creates all the folders needed to create a spreadsheet, as well as the files that won't change.

Exceptions
IOExceptionIf unable to create at least one of the base folders

Implemented in OpenSpout\Writer\ODS\Helper\FileSystemHelper.

◆ createFileWithContents()

OpenSpout\Common\Helper\FileSystemHelperInterface::createFileWithContents ( string $parentFolderPath,
string $fileName,
string $fileContents )
inherited

Creates a file with the given name and content in the given folder.

The parent folder must exist.

Parameters
string$parentFolderPathThe parent folder path where the file is going to be created
string$fileNameThe name of the file to create
string$fileContentsThe contents of the file to create
Return values
stringPath of the created file
Exceptions
IOExceptionIf unable to create the file or if the file path is not inside of the base folder

Implemented in OpenSpout\Common\Helper\FileSystemHelper, and OpenSpout\Writer\ODS\Helper\FileSystemHelper.

◆ createFolder()

OpenSpout\Common\Helper\FileSystemHelperInterface::createFolder ( string $parentFolderPath,
string $folderName )
inherited

Creates an empty folder with the given name under the given parent folder.

Parameters
string$parentFolderPathThe parent folder path under which the folder is going to be created
string$folderNameThe name of the folder to create
Return values
stringPath of the created folder
Exceptions
IOExceptionIf unable to create the folder or if the folder path is not inside of the base folder

Implemented in OpenSpout\Common\Helper\FileSystemHelper, and OpenSpout\Writer\ODS\Helper\FileSystemHelper.

◆ deleteFile()

OpenSpout\Common\Helper\FileSystemHelperInterface::deleteFile ( string $filePath)
inherited

Delete the file at the given path.

Parameters
string$filePathPath of the file to delete
Exceptions
IOExceptionIf the file path is not inside of the base folder

Implemented in OpenSpout\Common\Helper\FileSystemHelper, and OpenSpout\Writer\ODS\Helper\FileSystemHelper.

◆ deleteFolderRecursively()

OpenSpout\Common\Helper\FileSystemHelperInterface::deleteFolderRecursively ( string $folderPath)
inherited

Delete the folder at the given path as well as all its contents.

Parameters
string$folderPathPath of the folder to delete
Exceptions
IOExceptionIf the folder path is not inside of the base folder

Implemented in OpenSpout\Common\Helper\FileSystemHelper, and OpenSpout\Writer\ODS\Helper\FileSystemHelper.


The documentation for this class was generated from the following file: