Class: atkFileUtils
Source Location: /utils/class.atkfileutils.inc
Class atkFileUtils
Method Summary
| static
bool
|
copyDirRecursive() |
This function copies everything what is in the source directory to the destination directory. |
| static
string
|
getFileMimetype() |
Get the Mimetype for a file the proper way. |
| static
bool
|
is_writable() |
This function checks if the root of the destination is writeable. |
| static
bool
|
mkdirRecursive() |
This function creates recursively a destination. This fuction accepts a full path ../dir/subdir/subdir2/subdir3 etc. It checks if the path is writeable and replace mis typed slashes with forward slashes. |
| static
string
|
parseDirectoryName() |
This function parse a templatestring with the data and returns a string with the data parsed in the template. |
| True |
rmdirRecursive() |
Delete complete directory and all of its contents. |
Methods
static string atkGetMimeTypeFromFileExtension(
string
$filename
)
|
|
Returns mimetype for the given filename, based on fileextension.
This function is different from mime_content_type because it does not access the file but just looks at the fileextension and returns the right mimetype.
Parameters:
|
string |
$filename: |
Filename (or just the extention) we want to know the mime type for. |
API Tags:
| Return: | The mimetype for this file extension. |
static bool copyDirRecursive(
string
$source, string
$dest, [string
$dirname = ''], [octal
$privileges = 0777]
)
|
|
This function copies everything what is in the source directory to the destination directory.
Parameters:
|
string |
$source: |
path to the skell to copy |
|
string |
$dest: |
path to where the skell has to be copied to |
|
string |
$dirname: |
unique name for the first directory |
|
octal |
$privileges: |
octal number for the rights of the written |
API Tags:
| Return: | returns true when skell is copied to the destination. |
| Staticvar: | $orgdest $orgdest: to store the first original destination. |
static string getFileMimetype(
string
$file_path
)
|
|
Get the Mimetype for a file the proper way.
Parameters:
|
string |
$file_path: |
Path to the file |
API Tags:
| Return: | Mimetype |
| Access: | public |
Information Tags:
static bool is_writable(
string
$orgdest
)
|
|
This function checks if the root of the destination is writeable.
The difference with php native function is that this functions accepts non-existing directories.
Parameters:
|
string |
$orgdest: |
document parh |
API Tags:
| Return: | returns true if the destination is writeable. |
static bool mkdirRecursive(
string
$dir, [octal
$privileges = 0777], [bool
$recursive = true]
)
|
|
This function creates recursively a destination. This fuction accepts a full path ../dir/subdir/subdir2/subdir3 etc. It checks if the path is writeable and replace mis typed slashes with forward slashes.
Parameters:
|
string |
$dir: |
the fullpath |
|
octal |
$privileges: |
octal number for the rights of the written |
|
bool |
$recursive: |
|
API Tags:
| Return: | returns true if the destination is written. |
static string parseDirectoryName(
string
$template, array
$data
)
|
|
This function parse a templatestring with the data and returns a string with the data parsed in the template.
Parameters:
|
string |
$template: |
the template to parse |
|
array |
$data: |
array which contains the data for the template |
API Tags:
| Return: | returns the parsed string |
True rmdirRecursive(
string
$dir
)
|
|
Delete complete directory and all of its contents.
Parameters:
|
string |
$dir: |
The directory to remove |
API Tags:
| Return: | if succesful, false if not |
Information Tags:
| Todo: | If one of the subdirs/files cannot be removed, you end up with a half deleted directory structure. |