Procedural File: _file.funcs.php
Source Location: /blogs/inc/MODEL/files/_file.funcs.php
Functions
string bytesreadable(
integer $bytes
)
|
|
Converts bytes to readable bytes/kb/mb/gb, like "12.45mb"
Parameters:
API Tags:
check_canonical_path [line 418]
array check_canonical_path(
string $path
)
|
|
Returns canonicalized absolute pathname as with realpath(), except it will also translate paths that don't exist on the system.
Parameters:
|
string |
$path: |
the path to be translated |
API Tags:
| Return: | [0] = the translated path (with trailing slash); [1] = TRUE|FALSE (path exists?) |
| Deprecated: | overly complex |
Information Tags:
deldir_recursive [line 249]
void deldir_recursive(
string $dir
)
|
|
Deletes a dir recursive, wiping out all subdirectories!!
Parameters:
get_admin_skins [line 148]
array|false get_admin_skins(
)
|
|
Get a list of available admin skins.
This checks if there's a _adminUI.class.php in there.
API Tags:
| Return: | List of directory names that hold admin skins or false, if the admin skins driectory does not exist. |
get_ads_canonical_path [line 381]
string|NULL get_ads_canonical_path(
string $ads_path
)
|
|
Returns canonicalized absolute pathname of a directory + ending slash
(a)bsolute (d)irectory (s)lash termintaed
Parameters:
|
string |
$ads_path: |
absolute path to be reduced ending with slash |
API Tags:
| Return: | absolute reduced path, slaah terminated or NULL if the path doesn't exist |
get_available_FileRoots [line 593]
array get_available_FileRoots(
)
|
|
Get an array of available Fileroots.
API Tags:
| Return: | of FileRoots (key being the FileRoot's ID) |
get_directory_tree [line 630]
string get_directory_tree(
[NULL|FileRoot $Root = NULL], [string $path = NULL], [array $params = array()], [ $rootSubpath = NULL], [ $name = NULL]
)
|
|
Get the directories of the supplied path as a radio button tree.
Parameters:
|
NULL|FileRoot |
$Root: |
A single root or NULL for all available. |
|
string |
$path: |
the root path to use |
|
array |
$params: |
Parameters - 'disp_radios': display a radio with each directory that's meant to select it in a form
|
|
|
$rootSubpath: |
|
|
|
$name: |
|
get_dirsize_recursive [line 230]
void get_dirsize_recursive(
string $path
)
|
|
Get size of a directory, including anything (especially subdirs) in there.
Parameters:
|
string |
$path: |
the dir's full path |
false|array get_filenames(
string $path, [boolean $inc_files = true], [boolean $inc_dirs = true], [boolean $flat = true], [boolean $recurse = true], [boolean $basename = false]
)
|
|
Get an array of all directories (and optionally files) of a given directory, either flat (one-dimensional array) or multi-dimensional (then dirs are the keys and hold subdirs/files).
Note: there is no ending slash on dir names returned.
Parameters:
|
string |
$path: |
the path to start |
|
boolean |
$inc_files: |
include files (not only directories) |
|
boolean |
$inc_dirs: |
include directories (not the directory itself!) |
|
boolean |
$flat: |
flat (return an one-dimension-array) |
|
boolean |
$recurse: |
Recurse into subdirectories? |
|
boolean |
$basename: |
Get the basename only. |
API Tags:
| Return: | false if the first directory could not be accessed, array of entries otherwise |
mixed imgsize(
string $path, [string $param = 'widthheight']
)
|
|
Get the size of an image file
Parameters:
|
string |
$path: |
absolute file path |
|
string |
$param: |
what property/format to get: 'width', 'height', 'widthxheight', 'type', 'string' (as for img tags), else 'widthheight' (array) |
API Tags:
void my_fnmatch(
$pattern, $file
)
|
|
A replacement for fnmatch() which needs PHP 4.3
Parameters:
Information Tags:
no_trailing_slash [line 358]
string no_trailing_slash(
string $path
)
|
|
Remove trailing slash, if present
Parameters:
|
string |
$path: |
the path/url |
API Tags:
| Return: | the path/url without trailing slash |
rel_path_to_base [line 565]
string rel_path_to_base(
string $path
)
|
|
Return the path without the leading $basepath, or if not below $basepath, just the basename of it.
Do not use this for file handling. but "just" displaying!
Parameters:
API Tags:
| Return: | Relative path or even base name. NOTE: when $debug, the real path gets appended. |
trailing_slash [line 339]
string trailing_slash(
string $path
)
|
|
Add a trailing slash, if none present
Parameters:
|
string |
$path: |
the path/url |
API Tags:
| Return: | the path/url with trailing slash |
validate_dirname [line 526]
nothing validate_dirname(
string $dirname
)
|
|
Check for valid dirname (no path allowed). ( MB )
Parameters:
|
string |
$dirname: |
dirname to test |
API Tags:
| Return: | if the dirname is valid according to the regular expression, error message if not |
| Uses: | $Settings - or $force_regexp_dirname form _advanced.php |
validate_filename [line 473]
nothing validate_filename(
string $filename
)
|
|
Check for valid filename and extension of the filename (no path allowed). (MB)
Parameters:
|
string |
$filename: |
filename to test |
API Tags:
| Return: | if the filename is valid according to the regular expression and the extension too, error message if not |
| Uses: | $FiletypeCache, - $settings or $force_regexp_filename form _advanced.php |