[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/phpgwapi/inc/ -> class.vfs_dav.inc.php (sommaire)

(pas de description)

Poids: 2938 lignes (77 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

vfs:: (52 méthodes):
  vfs()
  debug()
  dav_path()
  glue_url()
  dav_host()
  vfs_umount()
  set_relative()
  get_relative()
  sanitize()
  securitycheck()
  db_clean()
  extra_sql()
  add_journal()
  flush_journal()
  get_journal()
  path_parts()
  getabsolutepath()
  acl_check()
  cd()
  pwd()
  read()
  view()
  lock()
  lock_token()
  add_lock_override()
  remove_lock_override()
  unlock()
  options()
  write()
  touch()
  cp()
  copy()
  mv()
  move()
  rm()
  delete()
  mkdir()
  make_link()
  set_attributes()
  correct_attributes()
  file_type()
  get_ext_mime_type()
  file_exists()
  get_size()
  checkperms()
  ls()
  dir()
  command_line()
  default_values()
  get_real_info()
  update_real()
  save_session()


Classe: vfs  - X-Ref

vfs()   X-Ref
constructor, sets up variables


debug($info)   X-Ref
Pas de description

dav_path($uri)   X-Ref
Apaches mod_dav in particular requires that the path sent in a dav request NOT be a URI


glue_url($url)   X-Ref
glues a parsed url (ie parsed using PHP's parse_url) back

together
param: $url    The parsed url (its an array)

dav_host($uri)   X-Ref
Pas de description

vfs_umount()   X-Ref
Pas de description

set_relative($data)   X-Ref
Set path relativity

param: mask Relative bitmask (see RELATIVE_ defines)

get_relative()   X-Ref
Return relativity bitmask

Returns relativity bitmask, or the default of "completely relative" if unset

sanitize($data)   X-Ref
Removes leading .'s from 'string'

You should not pass all filenames through sanitize () unless you plan on rejecting
* .files.  Instead, pass the name through securitycheck () first, and if it fails,
* pass it through sanitize
param: string string to sanitize
return: $string 'string' without it's leading .'s

securitycheck($data)   X-Ref
Security check function

Checks for basic violations such as ..
* If securitycheck () fails, run your string through vfs->sanitize ()
param: string string to check security of
return: Boolean True/False.  True means secure, False means insecure

db_clean($data)   X-Ref
Clean 'string' for use in database queries

param: string String to clean
return: Cleaned version of 'string'

extra_sql($data)   X-Ref
Return extra SQL code that should be appended to certain queries

param: query_type The type of query to get extra SQL code for, in the form of a VFS_SQL define
return: Extra SQL code

add_journal($data)   X-Ref
Add a journal entry after (or before) completing an operation,

* and increment the version number.  This function should be used internally only
Note that state_one and state_two are ignored for some VFS_OPERATION's, for others
*     they are required.  They are ignored for any "custom" operation
*     The two operations that require state_two:
*     operation         *     state_two
*     VFS_OPERATION_COPIED    fake_full_path of copied to
*     VFS_OPERATION_MOVED         * fake_full_path of moved to
*     If deleting, you must call add_journal () before you delete the entry from the database
param: string File or directory to add entry for
param: relatives Relativity array
param: operation The operation that was performed.  Either a VFS_OPERATION define or
param: state_one The first "state" of the file or directory.  Can be a file name, size,
param: state_two The second "state" of the file or directory
param: incversion Boolean True/False.  Increment the version for the file?  Note that this is
return: Boolean True/False

flush_journal($data)   X-Ref
Flush journal entries for $string.  Used before adding $string

flush_journal () is an internal function and should be called from add_journal () only
param: string File/directory to flush journal entries of
param: relatives Realtivity array
param: deleteall Delete all types of journal entries, including the active Create entry.
param: deletedonly Only flush 'journal-deleted' entries (created when $string was deleted)
return: Boolean True/False

get_journal($data)   X-Ref
Retrieve journal entries for $string

param: string File/directory to retrieve journal entries of
param: relatives Relativity array
param: type 0/False = any, 1 = 'journal', 2 = 'journal-deleted'
return: Array of arrays of journal entries

path_parts($data)   X-Ref
take a real or fake pathname and return an array of its component parts

param: string full real or fake path
param: relatives Relativity array
param: object True returns an object instead of an array
param: nolinks Don't check for links (made with make_link ()).  Used internally to prevent recursion
return: $rarray/$robject Array or object containing the fake and real component parts of the path

getabsolutepath($data)   X-Ref
get the absolute path

param: string defaults to False, directory/file to get path of, relative to relatives[0]
param: mask Relativity bitmask (see RELATIVE_ defines).  RELATIVE_CURRENT means use $this->relative
param: fake Returns the "fake" path, ie /home/user/dir/file (not always possible.  use path_parts () instead)
return: $basedir Full fake or real path

acl_check($data)   X-Ref
Check ACL access to $file for $GLOBALS['egw_info']["user"]["account_id"];

param: string File to check access of
param: relatives Standard relativity array
param: operation Operation to check access to.  In the form of a EGW_ACL defines bitmask.  Default is read
param: owner_id Owner id to check access of (see discussion above)
param: must_exist Boolean.  Set to True if 'string' must exist.  Otherwise, we check the parent directory as well
return: Boolean.  True if access is ok, False otherwise

cd($data = '')   X-Ref
Change directory

To cd to the files root '/', use cd ('/', False, array (RELATIVE_NONE));
param: string default '/'.  directory to cd into.  if "/" and $relative is True, uses "/home/<working_lid>";
param: relative default True/relative means add target to current path, else pass $relative as mask to getabsolutepath()
param: relatives Relativity array

pwd($data = '')   X-Ref
current working dir

param: full default True returns full fake path, else just the extra dirs (false strips the leading /)
return: $currentdir currentdir

read($data)   X-Ref
return file contents

param: string filename
param: relatives Relativity array
return: $contents Contents of $file, or False if file cannot be read

view($data)   X-Ref
Pas de description

lock($data)   X-Ref
Pas de description

lock_token($data)   X-Ref
Pas de description

add_lock_override($data)   X-Ref
Pas de description

remove_lock_override($data)   X-Ref
Pas de description

unlock($data, $token)   X-Ref
Pas de description

options($option)   X-Ref
Pas de description

write($data)   X-Ref
write to a file

param: string file name
param: relatives Relativity array
param: content content
return: Boolean True/False

touch($data)   X-Ref
Create blank file $file or set the modification time and modified by of $file to current time and user

param: string File to touch or set modifies
param: relatives Relativity array
return: Boolean True/False

cp($data)   X-Ref
copy file

param: from from file/directory
param: to to file/directory
param: relatives Relativity array
return: boolean True/False

copy($data)   X-Ref
Pas de description

mv($data)   X-Ref
move file/directory

param: from from file/directory
param: to to file/directory
param: relatives Relativity array
return: boolean True/False

move($data)   X-Ref
shortcut to mv


rm($data)   X-Ref
delete file/directory

param: string file/directory to delete
param: relatives Relativity array
return: boolean True/False

delete($data)   X-Ref
shortcut to rm


mkdir($data)   X-Ref
make a new directory

param: string Directory name
param: relatives Relativity array
return: boolean True on success

make_link($data)   X-Ref
Make a link from virtual directory 'vdir' to real directory 'rdir'

Making a link from 'vdir' to 'rdir' will cause path_parts () to substitute 'rdir' for the real
* path variables when presented with 'vdir'
param: vdir Virtual dir to make link from
param: rdir Real dir to make link to
param: relatives Relativity array
return: Boolean True/False

set_attributes($data,$operation=EGW_ACL_EDIT)   X-Ref
Update database entry for 'string' with the attributes in 'attributes'

param: string file/directory to update
param: relatives Relativity array
param: attributes keyed array of attributes.  key is attribute name, value is attribute value
return: Boolean True/False

correct_attributes($data)   X-Ref
Set the correct attributes for 'string' (e.g. owner)

param: string File/directory to correct attributes of
param: relatives Relativity array
return: Boolean True/False

file_type($data)   X-Ref
return file/dir type (MIME or other)

param: string File or directory path (/home/user/dir/dir2/dir3, /home/user/dir/dir2/file)
param: relatives Relativity array
return: MIME type, "Directory", or nothing if MIME type is not known

get_ext_mime_type($data)   X-Ref
return MIME type based on file extension

Authors: skeeter
*      Internal use only.  Applications should call vfs->file_type ()
param: string File name, with or without leading paths
return: MIME type based on file extension

file_exists($data)   X-Ref
check if file/directory exists

param: string file/directory to check existance of
param: relatives Relativity array
return: Boolean True/False

get_size($data)   X-Ref
Return size of 'string'

param: string file/directory to get size of
param: relatives Relativity array
param: checksubdirs Boolean, recursively add the size of all sub directories as well?
return: Size of 'string' in bytes

checkperms($data)   X-Ref
Check if $this->working_id has write access to create files in $dir

Simple call to acl_check
param: string Directory to check access of
param: relatives Relativity array
return: Boolean True/False

ls($data)   X-Ref
get directory listing or info about a single file

Note: The entries are not guaranteed to be returned in any logical order
*     Note: The size for directories does not include subfiles/subdirectories.
*     If you need that, use $this->get_size ()
param: string File or Directory
param: relatives Relativity array
param: checksubdirs Boolean, recursively list all sub directories as well?
param: mime_type Only return entries matching MIME-type 'mime_type'.  Can be any MIME-type, "Directory" or "\ " for those without MIME types
param: nofiles Boolean.  True means you want to return just the information about the directory $dir.  If $dir is a file, $nofiles is implied.  This is the equivalent of 'ls -ld $dir'
param: orderby How to order results.  Note that this only works for directories inside the virtual root
return: array of arrays.  Subarrays contain full info for each file/dir.

dir($data)   X-Ref
shortcut to ls


command_line($data)   X-Ref
Process and run a Unix-sytle command line

EXPERIMENTAL.  DANGEROUS.  DO NOT USE THIS UNLESS YOU KNOW WHAT YOU'RE DOING!
*     This is mostly working, but the command parser needs to be improved to take
*     files with spaces into consideration (those should be in "").
param: command_line Unix-style command line with one of the commands in the $args array
return: $result The return value of the actual VFS call

default_values($data, $default_values)   X-Ref
Pas de description

get_real_info($data)   X-Ref
Pas de description

update_real()   X-Ref
Pas de description

save_session()   X-Ref
Pas de description



Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7