\Pluf_FileUtil

File utilities.

Summary

Methods
Properties
Constants
isSupportedExtension()
getMimeType()
getMimeTypeFromContent()
isText()
removedir()
copyFile()
zipFolder()
unzipToFolder()
createTempFolder()
$supportedExtenstions
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$supportedExtenstions

$supportedExtenstions : 

Extension supported by the syntax highlighter.

Type

Methods

isSupportedExtension()

isSupportedExtension(  $extension) : boolean

Test if an extension is supported by the syntax highlighter.

Parameters

$extension

Returns

boolean

getMimeType()

getMimeType(  $file) 

Find the mime type of a file.

Use /etc/mime.types to find the type.

Parameters

$file

getMimeTypeFromContent()

getMimeTypeFromContent(  $file,   $filedata) : array

Find the mime type of a file using the fileinfo class.

Parameters

$file
$filedata

Returns

array —

Mime type found or 'application/octet-stream', basename, extension

isText()

isText(  $fileinfo) : boolean

Find if a given mime type is a text file.

This uses the output of the self::getMimeType function.

Parameters

$fileinfo

Returns

boolean —

Is text

removedir()

removedir(  $dir) 

Parameters

$dir

copyFile()

copyFile(  $from,   $to) 

Copys file intot the folderTo

Parameters

$from
$to

zipFolder()

zipFolder(  $folder,   $zipFilePath) 

Parameters

$folder
$zipFilePath

unzipToFolder()

unzipToFolder(  $folder,   $zipFilePath) 

Parameters

$folder
$zipFilePath

createTempFolder()

createTempFolder(  $pre = '') 

Parameters

$pre