\ManiaControl\FilesFileUtil

Files Utility Class

Summary

Methods
Properties
Constants
loadFile()
loadConfig()
getClearedFileName()
deleteTempFolder()
deleteFolder()
isFolderEmpty()
getTempFolder()
checkWritePermissions()
cleanDirectory()
appendDirectorySeparator()
isPhpFileName()
getFileName()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

loadFile()

loadFile(  $url) 

Parameters

$url

loadConfig()

loadConfig(string  $fileName) : \SimpleXMLElement

Load Config XML File

Parameters

string $fileName

Returns

\SimpleXMLElement

getClearedFileName()

getClearedFileName(string  $fileName) : string

Return file name cleared from special characters

Parameters

string $fileName

Returns

string

deleteTempFolder()

deleteTempFolder() : boolean

Delete the temporary folder if it's empty

Returns

boolean

deleteFolder()

deleteFolder(string  $folderPath, boolean  $onlyIfEmpty = true) : boolean

Delete the given folder if it's empty

Parameters

string $folderPath
boolean $onlyIfEmpty

Returns

boolean

isFolderEmpty()

isFolderEmpty(string  $folderPath) : boolean

Check if the given folder is empty

Parameters

string $folderPath

Returns

boolean

getTempFolder()

getTempFolder() : string|boolean

Get the temporary folder and create it if necessary

Returns

string|boolean

checkWritePermissions()

checkWritePermissions(mixed  $directories) : boolean

Check if ManiaControl has sufficient Access to write to Files in the given Directories

Parameters

mixed $directories

Returns

boolean

cleanDirectory()

cleanDirectory(string  $directory, float  $maxFileAgeInDays = 10.0, boolean  $recursive = false) : boolean

Clean the given directory by deleting old files

Parameters

string $directory
float $maxFileAgeInDays
boolean $recursive

Returns

boolean

appendDirectorySeparator()

appendDirectorySeparator(string  $path) : string

Append the directory separator to the given path if necessary

Parameters

string $path

Returns

string

isPhpFileName()

isPhpFileName(string  $fileName) : boolean

Check whether the given file name is a PHP file

Parameters

string $fileName

Returns

boolean

getFileName()

getFileName(  $path) : string

Returns the file name of a path to a PHP file

Parameters

$path

Returns

string