pcf_checkDir (line
177)
checks if a directory exists and create it if necessary
returns 1 if the directory exists returns 2 if there is a symlink with the name returns 3 if a new Directory is created returns False if the directory does not exists or could not be created
int
pcf_checkDir
(string $aDir, [boolean $createDir = False], [octal $rMask = 0770], [boolean $debug = False])
-
string
$aDir: the directory
-
boolean
$createDir: create the dir if not exists
-
octal
$rMask: fileMask of the new directory if one is created
-
boolean
$debug
pcf_checkDirName (line
219)
replaces some chars in $dirname which can cause problems
string
pcf_checkDirName
(string $dirName, [bool $isPath = False], [char $pathSep = _OCSP_DIRSEP_])
-
string
$dirName
-
bool
$isPath: $dirName is a Path with
-
char
$pathSep
pcf_dirArray (line
54)
returns an array of directories like a tree
Example:
1: /home 2: /home/user1 3: /home/user1/public_html 4: /home/user2 5: /home/user2/mail ....
this function calls itself recursive until $level==0 or no subdirectories exists
this function is slow with a large directory tree
take care start point ($aDir) is set correct to avoid:
- open_basedir restrictions
- safe_mode restrictions
- not getting the whole dir structure as result
void
pcf_dirArray
(string $aDir, array &$dirArr, [bool $goDown = TRUE], [string $path = ""], [string $excludes = ""], [int $levels = 10])
-
string
$aDir: start directory
-
array
&$dirArr: return array
-
bool
$goDown: add subdirectory subdirs to array
-
string
$path: path to add to the dirArray Value
-
string
$excludes: do not add this directories and subdirectories
-
int
$levels: max number of going into subdir
pcf_getDirList (line
103)
returns an array with files of a specified type in a directory
possible types:
. !D = WITHOUT DIRECTORIES (pk-04-08-18)
Combination of types are also allowed FL returns files and links
array
pcf_getDirList
(string $dirName, [string $type = "F"], [boolean $debug = FALSE], [array $blackList = array()])
-
string
$dirName: (the directory)
-
string
$type: (file type(s))
-
boolean
$debug
-
array
$blackList
pcf_getDirTree (line
247)
sets $dirArr with files, symlinks and dirs for a file tree
void
pcf_getDirTree
( &$dirArr, string $startDir, [string $subDir = ""], [string $filter = ""], [string $debug = FALSE], array $dirArr)
-
array
$dirArr
-
string
$startDir
-
string
$subDir
-
string
$filter
-
string
$debug
-
&$dirArr
pcf_is_dir (line
348)
checks if a file is a directory
boolean
pcf_is_dir
(string $path)
pcf_mkdir (line
273)
creates a direcotry
bool
pcf_mkdir
(string $strPath, [octal $mode = 0775])
-
string
$strPath
-
octal
$mode: create mode
pcf_mkdirs (line
317)
creates a direcotry with parentdir if not exists
bool
pcf_mkdirs
(string $strPath, [octal $mode = 0775], [bool $debug = FALSE])
-
string
$strPath
-
octal
$mode: create mode
-
bool
$debug: (pk-03-12-19)
pcf_rmdir (line
290)
remove a directory and everything that's in it.
void
pcf_rmdir
(string $dirname, [boolean $debug = FALSE])
-
string
$dirname
-
boolean
$debug