|
wCMF
3.6
|
Public Member Functions | |
| getErrorMsg () | |
| uploadFile ($mediaFile, $destName, $mimeType=null, $maxSize=-1, $override=true) | |
| fputsUnicode ($fp, $str) | |
| getFiles ($directory, $pattern='/./', $prependDirectoryName=false, $recursive=false) | |
| getDirectories ($directory, $pattern='/./', $prependDirectoryName=false, $recursive=false) | |
| copyRec ($source, $dest) | |
| copyRecDir ($source, $dest) | |
| mkdirRec ($dirname) | |
| emptyDir ($dirname) | |
| getRelativePath ($path1, $path2) | |
| sanitizeFilename ($name) | |
Public Attributes | |
| $_errorMsg = '' | |
FileUtil provides basic support for file functionality like HTTP file upload.
Definition at line 31 of file class.FileUtil.php.
| FileUtil::getErrorMsg | ( | ) |
Get last error message.
Definition at line 39 of file class.FileUtil.php.
References $_errorMsg.
| FileUtil::uploadFile | ( | $mediaFile, | |
| $destName, | |||
$mimeType = null, |
|||
$maxSize = -1, |
|||
$override = true |
|||
| ) |
Copy an uploaded file to a given destination (only if the mime type mathes the given one).
| mediaFile | An assoziative array with the following keys: 'name', 'type', 'size', 'tmp_name' (typically a $HTTP_POST_FILES entry) |
| destName | The destination file name |
| mimeType | An array holding the allowed mimetypes, null if arbitrary [default: null] |
| maxSize | The maximum size of the file (if -1 it's not limited) [default: -1] |
| override | True/False whether an existing file should be overridden, if false an unque id will be placed in the filename to prevent overriding [default: true] |
Definition at line 52 of file class.FileUtil.php.
References Message\get(), and InifileParser\getInstance().
Here is the call graph for this function:| FileUtil::fputsUnicode | ( | $fp, | |
| $str | |||
| ) |
Write unicode to file.
| fp | File Handle |
| str | String to write |
Definition at line 111 of file class.FileUtil.php.
Referenced by XMLExportController\endTags(), XMLExportController\finishExport(), XMLExportController\initExport(), and XMLExportController\writeNode().
| FileUtil::getFiles | ( | $directory, | |
$pattern = '/./', |
|||
$prependDirectoryName = false, |
|||
$recursive = false |
|||
| ) |
Definition at line 123 of file class.FileUtil.php.
References Message\get().
Referenced by emptyDir().
Here is the call graph for this function:| FileUtil::getDirectories | ( | $directory, | |
$pattern = '/./', |
|||
$prependDirectoryName = false, |
|||
$recursive = false |
|||
| ) |
Definition at line 167 of file class.FileUtil.php.
References Message\get().
Referenced by emptyDir(), and CreateInstanceController\executeKernel().
Here is the call graph for this function:| FileUtil::copyRec | ( | $source, | |
| $dest | |||
| ) |
Recursive copy for files/directories.
| source | The name of the source directory/file |
| dest | The name of the destination directory/file |
Definition at line 208 of file class.FileUtil.php.
References copyRecDir(), Message\get(), and WCMFException\throwEx().
Referenced by copyRecDir().
Here is the call graph for this function:| FileUtil::copyRecDir | ( | $source, | |
| $dest | |||
| ) |
Recursive copy for directories.
| source | The name of the source directory |
| dest | The name of the destination directory |
Definition at line 226 of file class.FileUtil.php.
References copyRec(), and mkdirRec().
Referenced by BackupController\backupFiles(), copyRec(), CreateInstanceController\executeKernel(), and BackupController\restoreFiles().
Here is the call graph for this function:| FileUtil::mkdirRec | ( | $dirname | ) |
Recursive directory creation.
| dirname | The name of the directory |
Definition at line 244 of file class.FileUtil.php.
Referenced by copyRecDir(), SearchUtil\getIndexPath(), SaveController\getUploadDir(), and View\setup().
| FileUtil::emptyDir | ( | $dirname | ) |
Empty a directory.
| dirname | The name of the directory |
Definition at line 259 of file class.FileUtil.php.
References getDirectories(), and getFiles().
Referenced by BackupController\restoreFiles().
Here is the call graph for this function:| FileUtil::getRelativePath | ( | $path1, | |
| $path2 | |||
| ) |
Get the relative path between two paths code from http://php.net/manual/en/ref.filesystem.php
| path1 | The first path |
| path2 | The second path |
Definition at line 275 of file class.FileUtil.php.
| FileUtil::sanitizeFilename | ( | $name | ) |
Sanitize a given filename (code from http://drupal.org/node/106377)
| name | The file name |
Definition at line 316 of file class.FileUtil.php.
Referenced by CreateInstanceController\getNewInstanceDatabase().
| FileUtil::$_errorMsg = '' |
Definition at line 33 of file class.FileUtil.php.
Referenced by getErrorMsg().