Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/backup/cc/cc_lib/gral_lib/pathutils.php File Reference

Go to the source code of this file.

Functions

 fullPath ($path, $dirsep=DIRECTORY_SEPARATOR)
 stripUrl ($path, $rootDir='')
 toNativePath (&$path)
 toNativePath2 (&$path)
 toUrlPath (&$path)
 pathDiff ($path1, $path2)
 copyr ($source, $dest)
 getDirectories ($rootDir, $contains, $excludeitems=null, $startswith=true)
 getFilesOnly ($rootDir, $contains, $excludeitems=null, $startswith=true, $extension=null)
 search_ident_by_name ($array, $name)
 getRawFiles ($startDir, &$fhandle, $rootDir='', $excludedirs=null, $excludefileext=null)
 getRawFiles2 ($startDir, &$arr, $rootDir='', $excludedirs=null, $excludefileext=null)
 GetFiles ($startDir, $outfile, $rootDir='', $excludedirs=null, $excludefileext=null)
 GetFilesArray ($startDir, $rootDir='', $excludedirs=null, $excludefileext=null)
 getCourseDirs ($rootDir, $contains, $excludeitems=null, $startswith=true)
 rmdirr ($dirname)

Function Documentation

copyr ( source,
dest 
)

Copy a file, or recursively copy a folder and its contents

Author:
Aidan Lister <aidan@php.net>
Version:
1.0.1 string $source Source path string $dest Destination path bool Returns TRUE on success, FALSE on failure

Definition at line 157 of file pathutils.php.

fullPath ( path,
dirsep = DIRECTORY_SEPARATOR 
)

Function expands all relative parts of supplied path string thus removing things like ../../ or ./../.

Parameters:
string$path
string$dirsepCharacter that represents directory separator should be specified here. Default is DIRECTORY_SEPARATOR.
Returns:
string

Definition at line 26 of file pathutils.php.

Here is the caller graph for this function:

getCourseDirs ( rootDir,
contains,
excludeitems = null,
startswith = true 
)

Function returns array with directories contained in folder (only first level) simmilar to getDirectories but returned items are naturally sorted.

Parameters:
string$rootDir
string$contains
array$excludeitems
bool$startswith
Returns:
array

Definition at line 386 of file pathutils.php.

Here is the call graph for this function:

getDirectories ( rootDir,
contains,
excludeitems = null,
startswith = true 
)

Function returns array with directories contained in folder (only first level)

Parameters:
string$rootDirdirectory to look into
string$containswhich string to look for
array$excludeitemsarray of names to be excluded
bool$startswithshould the $contains value be searched only from beginning
Returns:
array Returns array of sub-directories. In case $rootDir path is invalid it returns FALSE.

Definition at line 199 of file pathutils.php.

Here is the caller graph for this function:

GetFiles ( startDir,
outfile,
rootDir = '',
excludedirs = null,
excludefileext = null 
)

Definition at line 348 of file pathutils.php.

Here is the call graph for this function:

GetFilesArray ( startDir,
rootDir = '',
excludedirs = null,
excludefileext = null 
)

Function to get an array with all files in a directory and subdirectories

Parameters:
string$startDir
string$rootDir
string$excludedirs
string$excludefileext
Returns:
array

Definition at line 368 of file pathutils.php.

Here is the call graph for this function:

getFilesOnly ( rootDir,
contains,
excludeitems = null,
startswith = true,
extension = null 
)

Definition at line 222 of file pathutils.php.

getRawFiles ( startDir,
&$  fhandle,
rootDir = '',
excludedirs = null,
excludefileext = null 
)

Function returns files recursivly with appeneded relative path

Parameters:
string$startDir
string$rootDir
array$excludedirs
array$excludefileext
Returns:
array

Definition at line 286 of file pathutils.php.

Here is the caller graph for this function:

getRawFiles2 ( startDir,
&$  arr,
rootDir = '',
excludedirs = null,
excludefileext = null 
)

Definition at line 316 of file pathutils.php.

Here is the caller graph for this function:

pathDiff ( path1,
path2 
)

Returns relative path from two directories with full path

Parameters:
string$path1
string$path2
Returns:
string

Definition at line 135 of file pathutils.php.

Here is the call graph for this function:

Here is the caller graph for this function:

rmdirr ( dirname)

Delete a directory recursive with files inside

Parameters:
string$dirname
Returns:
bool

Definition at line 402 of file pathutils.php.

search_ident_by_name ( array,
name 
)

Search an identifier in array

Parameters:
array$array
string$name

Definition at line 258 of file pathutils.php.

stripUrl ( path,
rootDir = '' 
)

Function strips url part from css link

Parameters:
string$path
string$rootDir
Returns:
string

Definition at line 72 of file pathutils.php.

Here is the call graph for this function:

Here is the caller graph for this function:

toNativePath ( &$  path)

Converts direcotry separator in given path to / to validate in CC Value is passed byref hence variable itself is changed

Parameters:
string$path

Definition at line 89 of file pathutils.php.

Here is the caller graph for this function:

toNativePath2 ( &$  path)

Converts direcotry separator in given path to the one on the server platform Value is passed byref hence variable itself is changed

Parameters:
string$path

Definition at line 105 of file pathutils.php.

toUrlPath ( &$  path)

Converts \ Directory separator to the / more suitable for URL

Parameters:
string$path

Definition at line 119 of file pathutils.php.

Here is the caller graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations