[ Index ]

PHP Cross Reference of Mambo 4.6.5

[ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/mambots/editors/mostlyce/jscripts/tiny_mce/imagemanager/Classes/ -> Files.php (summary)

File Utilities.

Author: $Author$
Version: $Id$
File Size: 215 lines (5 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Files:: (9 methods):
  copyFile()
  createFolder()
  escape()
  delFile()
  delFolder()
  fixPath()
  makePath()
  makeFile()
  formatSize()


Class: Files  - X-Ref

File Utilities

copyFile($source, $destination_dir, $destination_file, $unique=true)   X-Ref
Copy a file from source to destination. If unique == true, then if
the destination exists, it will be renamed by appending an increamenting
counting number.

param: string $source where the file is from, full path to the files required
param: string $destination_file name of the new file, just the filename
param: string $destination_dir where the files, just the destination dir,
param: boolean $unique create unique destination file if true.
return: string the new copied filename, else error if anything goes bad.

createFolder($newFolder)   X-Ref
Create a new folder.

param: string $newFolder specifiy the full path of the new folder.
return: boolean true if the new folder is created, false otherwise.

escape($filename)   X-Ref
Escape the filenames, any non-word characters will be
replaced by an underscore.

param: string $filename the orginal filename
return: string the escaped safe filename

delFile($file)   X-Ref
Delete a file.

param: string $file file to be deleted
return: boolean true if deleted, false otherwise.

delFolder($folder, $recursive=false)   X-Ref
Delete folder(s), can delete recursively.

param: string $folder the folder to be deleted.
param: boolean $recursive if true, all files and sub-directories
return: boolean true if deleted.

fixPath($path)   X-Ref
Append a / to the path if required.

param: string $path the path
return: string path with trailing /

makePath($pathA, $pathB)   X-Ref
Concat two paths together. Basically $pathA+$pathB

param: string $pathA path one
param: string $pathB path two
return: string a trailing slash combinded path.

makeFile($pathA, $pathB)   X-Ref
Similar to makePath, but the second parameter
is not only a path, it may contain say a file ending.

param: string $pathA the leading path
param: string $pathB the ending path with file
return: string combined file path.

formatSize($size)   X-Ref
Format the file size, limits to Mb.

param: int $size the raw filesize
return: string formated file size.