tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Procedural File: filesystem_functions.inc.php

Source Location: /filesystem_toolbox/filesystem_functions.inc.php

Page Details

Contains various function for working with filesystem

Filesource:  Source Code for this file
Functions
dir_disk_usage  [line 327]

integer dir_disk_usage( string $location, [array $exclude = array()]  )

Returns disk usage of directory $location in bytes.

This function is taken from comments in PHP Manual. Credits to Gregor Mosheh. Warning: it can be very slow in windows for dirs with more than 1000 files

Parameters:
string   $location:  Target directory
array   $exclude:  array of file patterns to be excluded from stat

API Tags:
Return:  Size of the disk usage is returned in bytes.


[ Top ]
empty_dir  [line 159]

boolean empty_dir( string $directory  )

Removes all content from dir.

Returns true on success, false otherwise

Parameters:
string   $directory: 


[ Top ]
find_files  [line 290]

array find_files( [directory $location = ''], [regex $fileregex = '']  )

Enter description here...

Parameters:
directory   $location:  where find starts $location
regex   $fileregex:  mathing filename $fileregex

API Tags:
Return:  Contains found files


[ Top ]
is_dir_empty  [line 137]

unknown is_dir_empty( unknown_type $directory  )

Check if the dir is empty.

assumes that parameter $dir i really directory. Unexpected behaviour if that is not satisfied. Returns true on success, false otherwise

Parameters:
unknown_type   $directory: 


[ Top ]
mkdir_ine  [line 253]

boolean mkdir_ine( string $dir  )

Creates directory if not already exists

Returns true on success, false otherwise

Parameters:
string   $dir:  Directory to be created

Information Tags:
Throws:  Tangra_Exception

[ Top ]
rmdirr  [line 227]

boolean rmdirr( string $directory  )

Removes directory

Removes directory (and it's entire content first, if necessarry) Returns true on success, false otherwise

Parameters:
string   $directory: 


[ Top ]
strip_dots_from_path  [line 275]

unknown strip_dots_from_path( unknown_type $path  )

Removes '../' sequence from path. Used internaly.

Parameters:
unknown_type   $path: 


[ Top ]
strip_last_item_from_path  [line 382]

unknown strip_last_item_from_path( unknown_type $path  )

Strips last item from path

Example: printbr(strip_last_item_from_path('/var/www/sites/somefile.php')); printbr(strip_last_item_from_path('/var/www/sites'))

Will produce: /var/www/sites /var/www

Parameters:
unknown_type   $path: 


[ Top ]
tangra_copy_dir_content  [line 24]

boolean tangra_copy_dir_content( string $source_dir, string$destination_dir $destination_dir, [boolean $is_root = true]  )

Copies entire directory content

Returns true on success, false otherwise

Parameters:
string   $source_dir:  Source directory
boolean   $is_root:  Used internally just on recursive calls
string$destination_dir   $destination_dir:  Destination directory


[ Top ]
tangra_copy_dir_content_wo_svn  [line 69]

boolean tangra_copy_dir_content_wo_svn( string $source_dir, string $destination_dir, [string $is_root = true]  )

Copies entire dir content without .svn subdirs

Returns true on success, false otherwise

Parameters:
string   $source_dir:  Source directory
string   $destination_dir:  Destination directory
string   $is_root:  Used internally just on recursive calls

API Tags:
See:  tangra_copy_dir_content()


[ Top ]
tangra_dir_exists  [line 116]

boolean tangra_dir_exists( string $path  )

Checks if directory exists and is really directory

Returns true if it is directory.

Parameters:
string   $path: 


[ Top ]
_empty_dir  [line 181]

boolean _empty_dir( unknown_type $directory  )

Removes all content from dir.

It is not intended to be called directly. Use @link empty_dir instead

Parameters:
unknown_type   $directory: 

API Tags:
See:  empty_dir()


[ Top ]