go-utils
[ class tree: go-utils ] [ index: go-utils ] [ all elements ]

Class: filesystem

Source Location: /classes/filesystem.class.inc

Class Overview

base_db
   |
   --db
      |
      --filesystem

This class contains functions for filesytem operations


Author(s):

Version:

  • $Id: filesystem.class.inc 1291 2008-10-30 12:01:11Z mschering $

Copyright:

  • Copyright Intermesh

Methods


Inherited Variables

Inherited Methods

Class: db

db::affected_rows()
Gets the number of affected rows in a previous MySQL operatio
db::connect()
Connnects to the database
db::escape()
Escapes a value to make it safe to send to MySQL
db::found_rows()
Returns the number of rows found when you have used SELECT SQL_CALC_FOUND_ROWS
db::free()
Frees the memory associated with a result
db::insert_id()
Returns the auto generated id used in the last query
db::next_record()
Walk the result set from a select query
db::num_fields()
Get the number of fields in a result
db::num_rows()
Return the number of rows found in the last select statement
db::query()
Queries the database
db::set_error()
Sets the error and errno property
db::__wakeup()
When this object is stored in a session it must reconnect when created by the session again.

Class: base_db

base_db::__construct()
Constructor a config object with db_host, db_pass, db_user and db_name may be passed so it can connect to a different database then the default.
base_db::affected_rows()
Gets the number of affected rows in a previous MySQL operatio
base_db::connect()
Connnects to the database
base_db::escape()
Escapes a value to make it safe to send to MySQL
base_db::f()
Fetch a single field from a result record
base_db::found_rows()
Returns the number of rows found when you have used SELECT SQL_CALC_FOUND_ROWS
base_db::free()
Frees the memory associated with a result
base_db::halt()
Halts when an error occurs
base_db::insert_id()
Returns the auto generated id used in the last query
base_db::insert_row()
Inserts a row in a table
base_db::lock()
Lock a table
base_db::nextid()
Get a next unique ID for a table. Used instead of auto increment so that we have better support for different database backends.
base_db::next_record()
Walk the reseult set from a select query
base_db::num_fields()
Get the number of fields in a result
base_db::num_rows()
Return the number of rows found in the last select statement
base_db::p()
Print a single field from a result record.
base_db::query()
Queries the database
base_db::replace_row()
Replaces a row in a table
base_db::set_config()
Set's the connection parameters. A config object with db_host, db_pass, db_user and db_name may be passed so it can connect to a different database then the default.
base_db::set_error()
Sets the error and errno property
base_db::set_parameters()
Set the connection parameters manually
base_db::unlock()
Unlock tables
base_db::update_row()
Updates a row from a table

Class Details

[line 26]
This class contains functions for filesytem operations

Tags:

author:  Merijn Schering <mschering@intermesh.nl>
version:  $Id: filesystem.class.inc 1291 2008-10-30 12:01:11Z mschering $
copyright:  Copyright Intermesh
uses:  db


[ Top ]


Class Methods


constructor filesystem [line 52]

void filesystem( )

Constructor. Inititates parent db class and defines if Group-Office permissions should be used. In most cases they should be used but when you just want to fetch some files as an administrator you can disable them.

Tags:

access:  public
[ Top ]

method check_path [line 172]

void check_path( unknown_type $path)

Make sure path ends with a slash

Parameters:

unknown_type   $path  

[ Top ]

method copy [line 311]

true copy( string $source_path, string $destination_path)

Copy a file or folder

Tags:

return:  on success

Parameters:

string   $source_path  
string   $destination_path  

[ Top ]

method delete [line 383]

bool delete( String $path)

Delete a file or folder

Tags:

return:  true on success

Parameters:

String   $path  

[ Top ]

method delete_file [line 438]

void delete_file( string $path)

Abstract method that is called when a file is deleted

Parameters:

string   $path  

[ Top ]

method delete_folder [line 449]

void delete_folder( string $path)

Abstract method that is called when a folder is deleted

Parameters:

string   $path  

[ Top ]

method get_files [line 602]

unknown get_files( string $path, [bool $gethidden = false])

Get an array of files in a folder

Parameters:

string   $path  
bool   $gethidden  

[ Top ]

method get_files_sorted [line 640]

array get_files_sorted( string $path, [sort_file $sort_field = 'utf8_basename'], [sort_direction $sort_direction = 'ASC'], [bool $gethidden = false])

returns all files of a folder sorted based on the result of a function passed that is performed on the pathname. (For example filesize();)

Tags:

return:  with folders (path,name, mtime,size,type)

Parameters:

string   $path  
bool   $gethidden   true if you want hidden files (eg. .svn)
sort_file   $sort_field   A php function performed on the path used for sorting. eg. filesize, basename
sort_direction   $sort_direction   ASC or DESC

[ Top ]

method get_folders [line 488]

array get_folders( string $path, [bool $gethidden = false])

Get an array of folders

Tags:

return:  with folders (path,name, mtime,size,type)

Parameters:

string   $path  
bool   $gethidden   true if you want hidden files (eg. .svn)

[ Top ]

method get_folders_sorted [line 529]

array get_folders_sorted( string $path, [sort_file $sort_field = 'utf8_basename'], [sort_direction $sort_direction = 'ASC'], [bool $gethidden = false])

returns all subfolders of a folder sorted based on the result of a function passed that is performed on the pathname. (For example filesize();)

Tags:

return:  with folders (path,name, mtime,size,type)

Parameters:

string   $path  
bool   $gethidden   true if you want hidden files (eg. .svn)
sort_file   $sort_field   A php function performed on the path used for sorting. eg. filesize, basename
sort_direction   $sort_direction   ASC or DESC

[ Top ]

method get_parent_path [line 461]

mixed get_parent_path( string $path)

Get the parent path of a file or folder

Tags:

return:  parent path or false

Parameters:

string   $path  

[ Top ]

method get_quota [line 98]

Array get_quota( [string $username = null])

Get the users quota of the local filesystem

Tags:

return:  with keys used and total size on disk.
access:  public

Parameters:

string   $username   The OS system username

[ Top ]

method get_usedspace [line 360]

int get_usedspace( string $path)

Get the diskspace used by a folder

Tags:

return:  Usage in bytes

Parameters:

string   $path  

[ Top ]

method has_read_permission [line 728]

bool has_read_permission( int $user_id, string $path)

Returns true if the path is readable

Parameters:

int   $user_id  
string   $path  

[ Top ]

method has_write_permission [line 715]

bool has_write_permission( int $user_id, string $path)

Returns true if the path is writable

Parameters:

int   $user_id  
string   $path  

[ Top ]

method is_sub_dir [line 154]

bool is_sub_dir( string $sub_path, string $parent_path)

Check if a path is a subdirectory of another path.

Tags:

access:  public

Parameters:

string   $sub_path   The subdirectory path to check
string   $parent_path   The parent path

[ Top ]

method mkdir_recursive [line 67]

bool mkdir_recursive( string $path)

Creates a directory recursively

Tags:

return:  True on success
access:  public

Parameters:

string   $path  

[ Top ]

method move [line 219]

bool move( string $source_path, string $destination_path)

Move a file or folder

Tags:

return:  true on success

Parameters:

string   $source_path  
string   $destination_path  

[ Top ]

method move_file [line 284]

void move_file( string $source_path, string $destination_path)

Abstract method that is called when a file is moved

Parameters:

string   $source_path  
string   $destination_path  

[ Top ]

method move_folder [line 297]

void move_folder( string $source_path, string $destination_path)

Abstract method that is called when a folder is moved

Parameters:

string   $source_path  
string   $destination_path  

[ Top ]

method size [line 188]

int size( string $path)

Calculate the size of a folder

Tags:

return:  The size in bytes

Parameters:

string   $path  

[ Top ]


Documentation generated on Thu, 30 Oct 2008 14:13:28 +0100 by phpDocumentor 1.4.0