b2evolution

Multilingual multiuser multiblog engine

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

Procedural File: _file.funcs.php

Source Location: /blogs/inc/files/model/_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.6.2.2 2008/05/26 19:22:53 fplanque Exp $
Copyright:  

(c)2003-2008 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 57]

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 ]
fnmatch  [line 44]

void fnmatch( $pattern, $string  )

A replacement for fnmatch() which needs PHP 4.3 and a POSIX compliant system (Windows is not).

Parameters:
   $pattern: 
   $string: 

Information Tags:
Author:  jk at ricochetsolutions dot com http://php.net/manual/function.fnmatch.php#71725

[ Top ]
get_admin_skins  [line 171]

array 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_canonical_path  [line 364]

string get_canonical_path( string $ads_path  )

Returns canonicalized pathname of a directory + ending slash

Parameters:
string   $ads_path:  absolute path to be reduced ending with slash

API Tags:
Return:  absolute reduced path, slash terminated or NULL if the path could not get canonicalized.


[ Top ]
get_directory_tree  [line 524]

string get_directory_tree( [FileRoot $Root = NULL], [string $ads_full_path = NULL], [boolean $ads_selected_full_path = NULL], [string $radios = false], [ $rds_rel_path = NULL], [ $is_recursing = false]  )

Get the directories of the supplied path as a radio button tree.

Parameters:
FileRoot   $Root:  A single root or NULL for all available.
string   $ads_full_path:  the root path to use
boolean   $ads_selected_full_path:  add radio buttons ?
string   $radios:  used by recursion
   $rds_rel_path: 
   $is_recursing: 

Information Tags:
Todo:  fp> Make a DirTree class (those static hacks suck)

[ Top ]
get_dirsize_recursive  [line 203]

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 112]

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 266]

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 ]
mkdir_r  [line 671]

boolean mkdir_r( string $dirName, [integer $chmod = NULL]  )

Create a directory recursively.

NOTE: this can be done with the "recursive" param in PHP5

Parameters:
string   $dirName:  directory name
integer   $chmod:  permissions

Information Tags:
Todo:  dh> simpletests for this (especially for open_basedir)

[ Top ]
no_trailing_slash  [line 345]

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 490]

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. JUST for displaying! (DEBUG MESSAGE added)

Parameters:
string   $path:  Path

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


[ Top ]
rmdir_r  [line 222]

void rmdir_r( string $path  )

Deletes a dir recursively, wiping out all subdirectories!!

Parameters:
string   $path:  the dir


[ Top ]
trailing_slash  [line 326]

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 454]

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 400]

nothing validate_filename( string $filename, [boolean $allow_locked_filetypes = false]  )

Check for valid filename and extension of the filename (no path allowed). (MB)

Parameters:
string   $filename:  filename to test
boolean   $allow_locked_filetypes: 

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 Sat, 06 Mar 2010 03:31:37 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).