b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 1.9) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Procedural File: _file.funcs.php

Source Location: /blogs/inc/MODEL/files/_file.funcs.php

Page Details

This file implements various File handling functions.

This file is part of the evoCore framework - http://evocore.net/ See also http://sourceforge.net/projects/evocms/.

Author:  fplanque: Francois PLANQUE.
Author:  blueyed: Daniel HAHLER.
Version:  $Id: _file.funcs.php,v 1.19.2.4 2006/11/04 19:54:53 fplanque Exp $
Copyright:  

(c)2003-2006 by Francois PLANQUE - http://fplanque.net/ Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - http://thequod.de/contact.

Filesource:  Source Code for this file
Functions
bytesreadable  [line 43]

string bytesreadable( integer $bytes  )

Converts bytes to readable bytes/kb/mb/gb, like "12.45mb"

Parameters:
integer   $bytes:  bytes

API Tags:
Return:  bytes made readable
Usedby:  File::get_size_formatted()


[ Top ]
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:
Todo:  remove

[ Top ]
deldir_recursive  [line 249]

void deldir_recursive( string $dir  )

Deletes a dir recursive, wiping out all subdirectories!!

Parameters:
string   $dir:  the dir


[ Top ]
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.


[ Top ]
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


[ Top ]
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)


[ Top ]
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: 


[ Top ]
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


[ Top ]
get_filenames  [line 88]

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


[ Top ]
imgsize  [line 279]

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:
Return:  false if no image, otherwise what was requested through $param
Usedby:  File::get_image_size()


[ Top ]
my_fnmatch  [line 180]

void my_fnmatch( $pattern, $file  )

A replacement for fnmatch() which needs PHP 4.3

Parameters:
   $pattern: 
   $file: 

Information Tags:
Author:  jcl [atNOSPAM] jcl [dot] name http://php.net/manual/function.fnmatch.php

[ Top ]
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


[ Top ]
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:
string   $path:  Path

API Tags:
Return:  Relative path or even base name. NOTE: when $debug, the real path gets appended.


[ Top ]
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


[ Top ]
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


[ Top ]
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


[ Top ]


Documentation generated on Tue, 18 Dec 2007 19:14:40 +0100 by phpDocumentor 1.4.0