A class helper to read or create files
| package |
jelix |
|---|---|
| subpackage |
utils |
copyDirectoryContent(string $sourcePath, string $targetPath, $overwrite = false)
| since | 1.6.19 |
|---|---|
stringthe path of the directory content. It does not create the directory itself into the target directory.
stringthe full path of the directory to where to copy the content. The directory is created if it does not exists.
createDir(string $dir, $chmod = null)
stringthe path of the directory
getMimeType(string $file) : string
| since | 1.1.6 |
|---|
stringThe full path of the file
stringthe MIME type of the file
getMimeTypeFromFilename(string $fileName) : string
| since | 1.1.10 |
|---|
stringthe file name
stringthe MIME type of the file
parseJelixPath(string $path) : string
stringthe path with parts to replace
stringthe path which is a system valid path
read(string $filename) : string
stringthe filename we're gonna read
stringthe content of the file. false if cannot read the file
removeDir(string $path, boolean $deleteParent = true, array $except = array()) : boolean
| since | 1.0b1 |
|---|---|
| author |
Loic Mathaud |
| Throws |
|
stringThe path of the directory to remove recursively
booleanIf the path must be deleted too
arrayfilenames and suffix of filename, for files to NOT delete
booleantrue if all the content has been removed
unparseJelixPath(string $path, string $beforeShortcut = '', string $afterShortcut = '') : string
stringthe system valid path
stringa string to be output before the Jelix shortcut
stringa string to be output after the Jelix shortcut
stringthe path with Jelix shortcuts parts
write( $file, $data, $chmod = null)
This function is heavily based on the way smarty process its own files. Is using a temporary file and then rename the file. We guess the file system will be smarter than us, avoiding a writing / reading while renaming the file. This method comes from CopixFile class of Copix framework
| author |
Gérald Croes |
|---|---|
| copyright |
2001-2005 CopixTeam |
| link | |
mimeTypes :