|
const | APP_NAME = 'Spout' |
|
const | CONTENT_XML_FILE_NAME = 'content.xml' |
|
const | MANIFEST_XML_FILE_NAME = 'manifest.xml' |
|
const | META_INF_FOLDER_NAME = 'META-INF' |
|
const | META_XML_FILE_NAME = 'meta.xml' |
|
const | MIMETYPE = 'application/vnd.oasis.opendocument.spreadsheet' |
|
const | MIMETYPE_FILE_NAME = 'mimetype' |
|
const | SHEETS_CONTENT_TEMP_FOLDER_NAME = 'worksheets-temp' |
|
const | STYLES_XML_FILE_NAME = 'styles.xml' |
|
|
string | $baseFolderRealPath |
| Real path of the base folder where all the I/O can occur.
|
|
string | $metaInfFolder |
| Path to the "META-INF" folder inside the root folder.
|
|
string | $rootFolder |
| Path to the root folder inside the temp folder where the files to create the ODS will be stored.
|
|
string | $sheetsContentTempFolder |
| Path to the temp folder, inside the root folder, where specific sheets content will be written to.
|
|
◆ __construct()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::__construct |
( |
| $baseFolderPath, |
|
|
| $zipHelper ) |
- Parameters
-
string | $baseFolderPath | The path of the base folder where all the I/O can occur |
ZipHelper | $zipHelper | Helper to perform tasks with Zip archive |
◆ copyFileContentsToTarget()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::copyFileContentsToTarget |
( |
| $sourceFilePath, |
|
|
| $targetResource ) |
|
protected |
Streams the content of the file at the given path into the target resource.
Depending on which mode the target resource was created with, it will truncate then copy or append the content to the target file.
- Parameters
-
string | $sourceFilePath | Path of the file whose content will be copied |
resource | $targetResource | Target resource that will receive the content |
- Return values
-
◆ createBaseFilesAndFolders()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::createBaseFilesAndFolders |
( |
| ) |
|
◆ createContentFile()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::createContentFile |
( |
| $worksheetManager, |
|
|
| $styleManager, |
|
|
| $worksheets ) |
Creates the "content.xml" file under the root folder.
- Parameters
-
WorksheetManager | $worksheetManager | |
StyleManager | $styleManager | |
Worksheet[] | $worksheets | |
- Return values
-
◆ createFileWithContents()
Box\Spout\Common\Helper\FileSystemHelper::createFileWithContents |
( |
| $parentFolderPath, |
|
|
| $fileName, |
|
|
| $fileContents ) |
|
inherited |
Creates a file with the given name and content in the given folder.
The parent folder must exist.
- Parameters
-
string | $parentFolderPath | The parent folder path where the file is going to be created |
string | $fileName | The name of the file to create |
string | $fileContents | The contents of the file to create |
- Exceptions
-
- Return values
-
string | Path of the created file |
Implements Box\Spout\Common\Helper\FileSystemHelperInterface.
◆ createFolder()
Box\Spout\Common\Helper\FileSystemHelper::createFolder |
( |
| $parentFolderPath, |
|
|
| $folderName ) |
|
inherited |
Creates an empty folder with the given name under the given parent folder.
- Parameters
-
string | $parentFolderPath | The parent folder path under which the folder is going to be created |
string | $folderName | The name of the folder to create |
- Exceptions
-
- Return values
-
string | Path of the created folder |
Implements Box\Spout\Common\Helper\FileSystemHelperInterface.
◆ createManifestFile()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::createManifestFile |
( |
| ) |
|
|
protected |
Creates the "manifest.xml" file under the "META-INF" folder (under root)
- Exceptions
-
- Return values
-
◆ createMetaFile()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::createMetaFile |
( |
| ) |
|
|
protected |
Creates the "meta.xml" file under the root folder.
- Exceptions
-
- Return values
-
◆ createMetaInfoFolderAndFile()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::createMetaInfoFolderAndFile |
( |
| ) |
|
|
protected |
Creates the "META-INF" folder under the root folder as well as the "manifest.xml" file in it.
- Exceptions
-
- Return values
-
◆ createMimetypeFile()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::createMimetypeFile |
( |
| ) |
|
|
protected |
Creates the "mimetype" file under the root folder.
- Exceptions
-
- Return values
-
◆ createRootFolder()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::createRootFolder |
( |
| ) |
|
|
protected |
Creates the folder that will be used as root.
- Exceptions
-
- Return values
-
◆ createSheetsContentTempFolder()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::createSheetsContentTempFolder |
( |
| ) |
|
|
protected |
Creates the temp folder where specific sheets content will be written to.
This folder is not part of the final ODS file and is only used to be able to jump between sheets.
- Exceptions
-
- Return values
-
◆ createStylesFile()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::createStylesFile |
( |
| $styleManager, |
|
|
| $numWorksheets ) |
Creates the "styles.xml" file under the root folder.
- Parameters
-
StyleManager | $styleManager | |
int | $numWorksheets | Number of created worksheets |
- Return values
-
◆ deleteFile()
Box\Spout\Common\Helper\FileSystemHelper::deleteFile |
( |
| $filePath | ) |
|
|
inherited |
◆ deleteFolderRecursively()
Box\Spout\Common\Helper\FileSystemHelper::deleteFolderRecursively |
( |
| $folderPath | ) |
|
|
inherited |
◆ deleteWorksheetTempFolder()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::deleteWorksheetTempFolder |
( |
| ) |
|
Deletes the temporary folder where sheets content was stored.
- Return values
-
◆ getRootFolder()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::getRootFolder |
( |
| ) |
|
◆ getSheetsContentTempFolder()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::getSheetsContentTempFolder |
( |
| ) |
|
◆ throwIfOperationNotInBaseFolder()
Box\Spout\Common\Helper\FileSystemHelper::throwIfOperationNotInBaseFolder |
( |
string | $operationFolderPath | ) |
|
|
protectedinherited |
All I/O operations must occur inside the base folder, for security reasons.
This function will throw an exception if the folder where the I/O operation should occur is not inside the base folder.
- Parameters
-
string | $operationFolderPath | The path of the folder where the I/O operation should occur |
- Exceptions
-
- Return values
-
◆ zipRootFolderAndCopyToStream()
Box\Spout\Writer\ODS\Helper\FileSystemHelper::zipRootFolderAndCopyToStream |
( |
| $streamPointer | ) |
|
Zips the root folder and streams the contents of the zip into the given stream.
- Parameters
-
resource | $streamPointer | Pointer to the stream to copy the zip |
- Return values
-
The documentation for this class was generated from the following file:
- lib/spout/src/Spout/Writer/ODS/Helper/FileSystemHelper.php