Moodle  2.2.1
http://www.collinsharper.com
Utility Class Reference

Public Member Functions

 getTimeStamp ()
 shortenFilename ($filename, $maxlength=80)
 writeError ($str)
 unixifyPath ($path)
 replaceBackslashes ($path)
 capitalizeDriveLetter ($path)
 makeDirRecursive ($dir, $mode=0755)
 getOS ()
 getTmpDir ()
 getLogger ($package=false)

Static Public Attributes

static $logger

Detailed Description

Definition at line 28 of file Utility.php.


Member Function Documentation

capitalizeDriveLetter ( path)

Convert the drive letter to upper case

Parameters:
$pathWindows path with "c:<blah>"
Returns:
String Path with driver letter capitalized. public

Definition at line 138 of file Utility.php.

Here is the caller graph for this function:

getLogger ( package = false)

Definition at line 211 of file Utility.php.

Here is the caller graph for this function:

getOS ( )

Returns the current OS code WIN - Windows, LIN -Linux, etc.

Returns:
String 3 letter code for current OS public
Since:
0.6.6

Definition at line 191 of file Utility.php.

Here is the caller graph for this function:

Return the current timestamp in human readable format. Thursday March 17, 2005 19:10:47

Returns:
Readable timestamp public

Definition at line 41 of file Utility.php.

getTmpDir ( )

Definition at line 197 of file Utility.php.

Here is the call graph for this function:

makeDirRecursive ( dir,
mode = 0755 
)

Make directory recursively. (Taken from: http://aidan.dotgeek.org/lib/?file=function.mkdirr.php)

Parameters:
$dirDirectory path to create
$mode=0755
Returns:
True on success, False on failure public

Definition at line 156 of file Utility.php.

Here is the call graph for this function:

replaceBackslashes ( path)

Convert the back slash path separators with forward slashes.

Parameters:
$pathWindows path with backslash path separators
Returns:
String Path with back slashes replaced with forward slashes. public

Definition at line 124 of file Utility.php.

Here is the call graph for this function:

Here is the caller graph for this function:

shortenFilename ( filename,
maxlength = 80 
)

Shorten the filename to some maximum characters

Parameters:
$filenameComplete file path
$maxlength=150Maximum allowable length of the shortened filepath
Returns:
Shortened file path public

Definition at line 59 of file Utility.php.

unixifyPath ( path)

Convert Windows paths to Unix paths

Parameters:
$pathFile path
Returns:
String Unixified file path public

Definition at line 105 of file Utility.php.

Here is the call graph for this function:

writeError ( str)

Write error log if debug is on

Parameters:
$strError string public

Definition at line 90 of file Utility.php.


Field Documentation

$logger [static]

Definition at line 30 of file Utility.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations