[ Index ] |
|
Code source de CMS made simple 1.0.5 |
[Code source] [Imprimer] [Statistiques]
File Utilities.
Author: | $Author: Wei Zhuo $ |
Version: | $Id: Files.php 2114 2005-11-04 21:51:13Z wishy $ |
Poids: | 215 lignes (5 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
Files:: (9 méthodes):
copyFile()
createFolder()
escape()
delFile()
delFolder()
fixPath()
makePath()
makeFile()
formatSize()
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. |
Généré le : Tue Apr 3 18:50:37 2007 | par Balluche grâce à PHPXref 0.7 |