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

Static Public Member Functions

static exists ($dir)
static fix ($dir)
static name ($file, $up=0)
static tmp ($sub= '')

Static Protected Member Functions

static _tmp ()

Static Protected Attributes

static $_tmp

Detailed Description

Definition at line 17 of file Dir.php.


Member Function Documentation

static _tmp ( ) [static, protected]

Returns the OS-specific temporary directory location.

Returns:
string The temp directory path.

Definition at line 166 of file Dir.php.

Here is the caller graph for this function:

static exists ( dir) [static]

Hack for [[php::is_dir() | ]] that checks the include_path.

Use this to see if a directory exists anywhere in the include_path.

{{code: php $dir = Solar_Dir::exists('path/to/dir') if ($dir) { $files = scandir($dir); } else { echo "Not found in the include-path."; } }}

Parameters:
string$dirCheck for this directory in the include_path.
Returns:
mixed If the directory exists in the include_path, returns the absolute path; if not, returns boolean false.

Definition at line 49 of file Dir.php.

static fix ( dir) [static]

"Fixes" a directory string for the operating system.

Use slashes anywhere you need a directory separator. Then run the string through fixdir() and the slashes will be converted to the proper separator (for example '\' on Windows).

Always adds a final trailing separator.

Parameters:
string$dirThe directory string to 'fix'.
Returns:
string The "fixed" directory string.

Definition at line 94 of file Dir.php.

static name ( file,
up = 0 
) [static]

Convenience method for dirname() and higher-level directories.

Parameters:
string$fileGet the dirname() of this file.
int$upMove up in the directory structure this many times, default 0.
Returns:
string The dirname() of the file.

Definition at line 112 of file Dir.php.

static tmp ( sub = '') [static]

Returns the OS-specific directory for temporary files.

Parameters:
string$subAdd this subdirectory to the returned temporary directory name.
Returns:
string The temporary directory path.

Definition at line 131 of file Dir.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

$_tmp [static, protected]

Definition at line 26 of file Dir.php.


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