FileHandlingUtility implements LoggerAwareInterface uses LoggerAwareTrait
Utility for dealing with files and folders.
This class is a specific ExtensionManager implementation and is not part of the Public TYPO3 API.
Table of Contents
Interfaces
- LoggerAwareInterface
Methods
- __construct() : mixed
- getExtensionDir() : string
- Returns the installation directory for an extension depending on the installation scope
- removeDirectory() : void
- Remove specified directory
- unpackExtensionFromExtensionDataArray() : void
- Unpack an extension in t3x data format and write files
- unzipExtensionFromFile() : void
- Unzip an extension.zip.
- addDirectory() : void
- Add specified directory
- createDirectoriesForExtensionFiles() : void
- Loops over an array of directories and creates them in the given root path It also creates nested directory structures
- enrichComposerJsonWithComposerCapableFields() : void
- Enriches an extension's composer.json with version and providesPackages if these fields are not yet present. Both are mandatory in classic mode: a package without them is not registered at all. The version is the one the caller knows, from the TER listing or the archive name; ext_emconf.php is not evaluated anymore. Packages listed in require/suggest that are neither TYPO3 framework packages nor known Composer dependencies are added as provided packages, as they cannot be installed via Composer in classic mode.
- extractDirectoriesFromExtensionData() : array
- Extract needed directories from given extensionDataFilesArray
- getRelativePath() : string
- makeAndClearExtensionDir() : string
- Removes the current extension of $type and creates the base folder for the new one (which is going to be imported)
- reloadPackageInformation() : void
- writeEmConfToFile() : void
- Constructs emConf and writes it to corresponding file
- writeExtensionFiles() : void
- Loops over an array of files and writes them to the given rootPath
Methods
__construct()
public
__construct(PackageManager $packageManager, EmConfUtility $emConfUtility, OpcodeCacheService $opcodeCacheService, ZipService $zipService, LanguageServiceFactory $languageServiceFactory) : mixed
Parameters
- $packageManager : PackageManager
- $emConfUtility : EmConfUtility
- $opcodeCacheService : OpcodeCacheService
- $zipService : ZipService
- $languageServiceFactory : LanguageServiceFactory
getExtensionDir()
Returns the installation directory for an extension depending on the installation scope
public
getExtensionDir(string $extensionKey) : string
Parameters
- $extensionKey : string
Return values
stringremoveDirectory()
Remove specified directory
public
removeDirectory(string $extDirPath) : void
Parameters
- $extDirPath : string
unpackExtensionFromExtensionDataArray()
Unpack an extension in t3x data format and write files
public
unpackExtensionFromExtensionDataArray(string $extensionKey, array $extensionData, string $version) : void
Parameters
- $extensionKey : string
- $extensionData : array
- $version : string
unzipExtensionFromFile()
Unzip an extension.zip.
public
unzipExtensionFromFile(string $file, string $extensionKey[, string $version = '' ]) : void
Parameters
- $file : string
-
path to zip file
- $extensionKey : string
-
the key of the extension the archive holds
- $version : string = ''
-
the version to write into composer.json when the manifest declares none
addDirectory()
Add specified directory
protected
addDirectory(string $extDirPath) : void
Parameters
- $extDirPath : string
createDirectoriesForExtensionFiles()
Loops over an array of directories and creates them in the given root path It also creates nested directory structures
protected
createDirectoriesForExtensionFiles(array $directories, string $rootPath) : void
Parameters
- $directories : array
- $rootPath : string
enrichComposerJsonWithComposerCapableFields()
Enriches an extension's composer.json with version and providesPackages if these fields are not yet present. Both are mandatory in classic mode: a package without them is not registered at all. The version is the one the caller knows, from the TER listing or the archive name; ext_emconf.php is not evaluated anymore. Packages listed in require/suggest that are neither TYPO3 framework packages nor known Composer dependencies are added as provided packages, as they cannot be installed via Composer in classic mode.
protected
enrichComposerJsonWithComposerCapableFields(string $extensionKey, string $extensionDir[, string $version = '' ]) : void
Parameters
- $extensionKey : string
- $extensionDir : string
- $version : string = ''
extractDirectoriesFromExtensionData()
Extract needed directories from given extensionDataFilesArray
protected
extractDirectoriesFromExtensionData(array $files) : array
Parameters
- $files : array
Return values
arraygetRelativePath()
protected
getRelativePath(string $absolutePath) : string
Parameters
- $absolutePath : string
Return values
stringmakeAndClearExtensionDir()
Removes the current extension of $type and creates the base folder for the new one (which is going to be imported)
protected
makeAndClearExtensionDir(string $extensionKey) : string
Parameters
- $extensionKey : string
Return values
stringreloadPackageInformation()
protected
reloadPackageInformation(string $extensionKey) : void
Parameters
- $extensionKey : string
writeEmConfToFile()
Constructs emConf and writes it to corresponding file
protected
writeEmConfToFile(string $extensionKey, array $emConfData, string $rootPath) : void
Parameters
- $extensionKey : string
- $emConfData : array
- $rootPath : string
writeExtensionFiles()
Loops over an array of files and writes them to the given rootPath
protected
writeExtensionFiles(array $files, string $rootPath) : void
Parameters
- $files : array
- $rootPath : string