Zikula_Core
[ class tree: Zikula_Core ] [ index: Zikula_Core ] [ all elements ]

Class: FileUtil

Source Location: /includes/pnobjlib/FileUtil.class.php

Class Overview


FileUtil


Methods



Class Details

[line 19]
FileUtil



[ Top ]


Class Methods


method deldir [line 243]

boolean deldir( path $path)

Recursiveley delete given directory path



Tags:

return:  The return code from rmdir()


Parameters:

path   $path   The path/folder we wish to delete

[ Top ]

method generateRandomFilename [line 131]

string generateRandomFilename( min $min, max $max, [useupper $useupper = false], [usenumbers $usenumbers = true], [usespecial $usespecial = false])

Generate a random filename



Tags:

return:  The generated filename extension


Parameters:

min   $min   Minimum number of characters
max   $max   Maximum number of characters
useupper   $useupper   whether to use uppercase characters
usenumbers   $usenumbers   whether to use numeric characters
usespecial   $usespecial   whether to use special characters

[ Top ]

method getBasename [line 56]

string getBasename( filename $filename)

Get the basename of a filename



Tags:

return:  The file's basename


Parameters:

filename   $filename   The filename to process

[ Top ]

method getExtension [line 74]

string getExtension( filename $filename, [keepDot $keepDot = false])

Get the file's extension



Tags:

return:  The file's extension


Parameters:

filename   $filename   The filename to process
keepDot   $keepDot   whether or not to return the '.' with the extension

[ Top ]

method getFilebase [line 29]

string getFilebase( filename $filename, [keepDot $keepDot = false])

Given a filename (complete with path) get the file basename



Tags:

return:  The file's filename


Parameters:

filename   $filename   The filename to process
keepDot   $keepDot   whether or not to return the dot with the basename

[ Top ]

method getFiles [line 170]

boolean getFiles( rootPath $rootPath, [recurse $recurse = true], [relativePath $relativePath = true], [extension $extension = null], [directories $directories = true])

Recursiveley generate a file listing



Tags:

return:  The return code from mkdir()


Parameters:

rootPath   $rootPath   The root-path we wish to start at
recurse   $recurse   whether or not to recurse directories (optional) (default=true)
relativePath   $relativePath   whether or not to list relative (vs abolute) paths (optional) (default=true)
extension   $extension   The file extension to scan for (optional) (default=null)
directories   $directories   Include directories in listing (optional) (default=true)

[ Top ]

method mkdirs [line 216]

boolean mkdirs( path $path, [mode $mode = null])

Recursiveley create a directory path



Tags:

return:  The return code from mkdir()


Parameters:

path   $path   The path we wish to generate
mode   $mode   The (UNIX) mode we wish to create the files with

[ Top ]

method randomizeFilename [line 320]

string randomizeFilename( filename $filename, dir $dir)

Take an existing filename and 'randomize' it



Tags:

return:  The 'randomized' filename


Parameters:

filename   $filename   The filename to randomize
dir   $dir   The directory the file should be in

[ Top ]

method readFile [line 272]

string readFile( filename $filename)

Read a file's contents and return them as a string. This method also opens and closes the file.



Tags:

return:  The file's contents or false upon failure


Parameters:

filename   $filename   The file to read

[ Top ]

method readFileLines [line 290]

string readFileLines( filename $filename)

Read a file's contents and return them as an array of lines.

This method also opens and closes the file.




Tags:

return:  The file's contents or false upon failure


Parameters:

filename   $filename   The file to read

[ Top ]

method readSerializedFile [line 306]

string readSerializedFile( filename $filename)

Read a serialized's file's contents and return them as a string This method also opens and closes the file.



Tags:

return:  The file's contents or false upon failure


Parameters:

filename   $filename   The file to read

[ Top ]

method stripExtension [line 101]

string stripExtension( filename $filename, [keepDot $keepDot = false])

Strip the file's extension



Tags:

return:  The filename without the extension


Parameters:

filename   $filename   The filename to process
keepDot   $keepDot   whether or not to return the '.' with the extension

[ Top ]

method uploadFile [line 402]

mixed uploadFile( key $key, destination $destination, [newName $newName = ''])

Upload a file



Tags:

return:  The return code from the fclose() call


Parameters:

key   $key   The filename key to use in accessing the file data
destination   $destination   The destination where the file should end up
newName   $newName   The new name to give the file (optional) (default='')

[ Top ]

method writeFile [line 358]

mixed writeFile( filename $filename, [data $data = ''])

Write a string to a file This method also opens and closes the file.

On versions >= PHP5 this method will use the file_put_contents API




Tags:

return:  The return code from the fclose() call


Parameters:

filename   $filename   The file to write
data   $data   The data to write to the file

[ Top ]

method writeSerializedFile [line 387]

mixed writeSerializedFile( filename $filename, data $data)

Write a serialized string to a file This method also opens and closes the file.



Tags:

return:  The return code from the fclose() call


Parameters:

filename   $filename   The file to write
data   $data   The data to write to the file

[ Top ]


Documentation generated on Fri, 18 Jul 2008 21:45:02 +0200 by phpDocumentor 1.4.1