[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
[Code source] [Imprimer] [Statistiques]
(pas de description)
Poids: | 1415 lignes (40 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
path_class:: (0 méthodes):
vfs_shared:: (37 méthodes):
vfs_shared()
add_journal()
flush_journal()
get_journal()
acl_check()
read()
view()
write()
touch()
cp()
mv()
rm()
mkdir()
set_attributes()
file_exists()
get_size()
ls()
make_link()
update_real()
compress()
extract()
securitycheck()
sanitize()
clean_string()
getabsolutepath()
get_ext_mime_type()
set_relative()
get_relative()
path_parts()
cd()
pwd()
copy()
move()
delete()
dir()
command_line()
default_values()
Classe: vfs_shared - X-Ref
* Base class for Virtual File System classesvfs_shared() X-Ref |
* constructor * * All derived classes should call this function in their constructor ($this->vfs_shared()) |
add_journal($data) X-Ref |
Pas de description |
flush_journal($data) X-Ref |
Pas de description |
get_journal($data) X-Ref |
* Get journal entries for a location * * string Path to location * relatives Relativity array (default: RELATIVE_CURRENT) * type [0|1|2] 0 = any journal entries 1 = current journal entries 2 = deleted journal entries * @return Array of arrays of journal entries The keys will vary depending on the implementation, with most attributes in this->attributes being valid, and these keys being mandatory: created - Datetime in SQL format that journal entry was entered comment - Human readable comment describing the action version - May be 0 if the derived class does not support versioning |
acl_check($data) X-Ref |
* Check access for a user to a given location * * If $this->override_acl is set, always return True * string Path to location * relatives Relativity array (default: RELATIVE_CURRENT) * operation Operation to check access for. Any combination of the EGW_ACL_* defines, for example: EGW_ACL_READ EGW_ACL_READ|EGW_ACL_WRITE * owner_id phpGW ID to check access for. * Default: $GLOBALS['egw_info']['user']['account_id'] * must_exist If set, string must exist, and acl_check() must return False if it doesn't. If must_exist isn't passed, and string doesn't exist, check the owner_id's access to the parent directory, if it exists. * @return Boolean. True if access is ok, False otherwise. |
read($data) X-Ref |
* Retreive file contents * * string Path to location * relatives Relativity array (default: RELATIVE_CURRENT) * @return String. Contents of 'string', or False on error. |
view($data) X-Ref |
Views the specified file (does not return!) param: string filename param: relatives Relativity array return: None (doesnt return) |
write($data) X-Ref |
* Store file contents * * string Path to location * relatives Relativity array (default: RELATIVE_CURRENT) * @return Boolean. True on success, False otherwise. |
touch($data) X-Ref |
* Create a file if it doesn't exist. * Optionally, update the modified time and modified user if the file exists. * string Path to location * relatives Relativity array (default: RELATIVE_CURRENT) * @return Boolean. True on success, False otherwise. |
cp($data) X-Ref |
* Copy location * * from Path to location to copy from * to Path to location to copy to * relatives Relativity array (default: RELATIVE_CURRENT, RELATIVE_CURRENT) * @return Boolean. True on success, False otherwise. |
mv($data) X-Ref |
* Move location * * from Path to location to move from * to Path to location to move to * relatives Relativity array (default: RELATIVE_CURRENT, RELATIVE_CURRENT) * @return Boolean. True on success, False otherwise. |
rm($data) X-Ref |
* Delete location * * string Path to location * relatives Relativity array (default: RELATIVE_CURRENT) * @return Boolean. True on success, False otherwise. |
mkdir($data) X-Ref |
* Create directory * * string Path to location * relatives Relativity array (default: RELATIVE_CURRENT) * @return Boolean. True on success, False otherwise. |
set_attributes($data) X-Ref |
* Set attributes for a location * * Valid attributes are listed in vfs->attributes, which may be extended by each derived class * string Path to location * relatives Relativity array (default: RELATIVE_CURRENT) * attributes Keyed array of attributes. Key is attribute name, value is attribute value. * @return Boolean. True on success, False otherwise. |
file_exists($data) X-Ref |
* Check if a location (file or directory) exists * * string Path to location * relatives Relativity array (default: RELATIVE_CURRENT) * @return Boolean. True if file exists, False otherwise. |
get_size($data) X-Ref |
* Determine size of location * * string Path to location * relatives Relativity array (default: RELATIVE_CURRENT) * checksubdirs Boolean. If set, include the size of all subdirectories recursively. * @return Integer. Size of location in bytes. |
ls($data) X-Ref |
* Return detailed information for location(s) * * string Path to location * relatives Relativity array (default: RELATIVE_CURRENT) * checksubdirs Boolean. If set, return information for all subdirectories recursively. * mime String. Only return information for locations with MIME type specified. VFS classes must recogize these special types: "Directory" - Location is a directory " " - Location doesn't not have a MIME type * nofiles Boolean. If set and 'string' is a directory, return information about the directory, not the files in it. * @return Array of arrays of file information. Keys may vary depending on the implementation, but must include at least those attributes listed in $this->attributes. |
make_link($data) X-Ref |
* Create a real to virtual directory link * * rdir Real directory to make link from/to * vdir Virtual directory to make link to/from * relatives Relativity array (default: RELATIVE_CURRENT, RELATIVE_CURRENT) * @return Boolean. True on success, False otherwise. |
update_real($data) X-Ref |
* Ensure that information about a location is up-to-date * * Some VFS backends store information about locations in a secondary location, for example in a database or in a cache file. update_real() can be called to ensure that the information in the secondary location is up-to-date. * string Path to location * relatives Relativity array (default: RELATIVE_CURRENT) * @return Boolean. True on success, False otherwise. |
compress($data) X-Ref |
* Creates an archive from a file or a set of files * * files File names to be stored in archive (array) * name Name of archive * type The type of compression, can be 'zip'(default)or 'gz' * relatives Relativity array (default: RELATIVE_CURRENT) * Note: the last item is the relativity of the dest archive * @return Boolean. True on success, False otherwise. |
extract($data) X-Ref |
* Extracts a file (or files) from archive * * name Name of archive * dest The destination path of files to be extracted * type The type of compression, can be 'zip' or 'gz'. If * not specified, uses according to the extension * files Files to be extracted from archive * relatives Relativity array (default: RELATIVE_CURRENT) * Note: the first item is the relativity of the archive, the last of * the dest dir * @return Boolean. True on success, False otherwise. |
securitycheck($data) X-Ref |
* Check if location string is ok to use in VFS functions * * Checks for basic violations such as .. If securitycheck () fails, run your string through $this->sanitize () * string Path to location * @return Boolean. True if string is ok, False otherwise. |
sanitize($data) X-Ref |
* Remove any possible security problems from a location * string (i.e. remove leading '..') * 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. * string Path to location * @return String. 'string' with any security problems fixed. |
clean_string($data) X-Ref |
* Clean location string. This function is used if * any special characters need to be escaped or removed before accessing a database, network protocol, etc. The default is to escape characters before doing an SQL query. * string Location string to clean * @return String. Cleaned version of 'string'. |
getabsolutepath($data) X-Ref |
* Translate a location string depending on the * relativity. This is the only function that is directly concerned with relativity. * string Path to location, relative to mask[0]. * Defaults to empty string. * mask Relativity array (default: RELATIVE_CURRENT) * fake Boolean. If set, returns the 'fake' path, i.e. /home/user/dir/file. This is not always possible, use path_parts() instead. * @return String. Full fake or real path, or False on error. |
get_ext_mime_type($data) X-Ref |
* Return MIME type based on file extension * * Internal use only. Applications should call vfs->file_type () * @author skeeter * string Real path to file, with or without leading paths * @return String. MIME type based on file extension. |
set_relative($data) X-Ref |
* Sets the current relativity, the relativity used * when RELATIVE_CURRENT is passed to a function * mask Relative bitmask. If not set, relativity will be returned to the default. * @return Void |
get_relative() X-Ref |
* Return the current relativity * * Returns relativity bitmask, or the default of "completely relative" if unset * @return Integer. One of the RELATIVE_* defines. |
path_parts($data) X-Ref |
* Return information about the component parts of a location string * * Most VFS functions call path_parts() with their 'string' and 'relatives' arguments before doing their work, in order to determine the file/directory to work on. * string Path to location * relatives Relativity array (default: RELATIVE_CURRENT) * object If set, return an object instead of an array * nolinks Don't check for linked directories (made with make_link()). Used internally to prevent recursion. * @return Array or object. Contains the fake and real component parts of the path. * Returned values are: mask outside fake_full_path fake_leading_dirs fake_extra_path BROKEN fake_name real_full_path real_leading_dirs real_extra_path BROKEN real_name fake_full_path_clean fake_leading_dirs_clean fake_extra_path_clean BROKEN fake_name_clean real_full_path_clean real_leading_dirs_clean real_extra_path_clean BROKEN real_name_clean "clean" values are run through vfs->clean_string () and are safe for use in SQL queries that use key='value' They should be used ONLY for SQL queries, so are used mostly internally mask is either RELATIVE_NONE or RELATIVE_NONE|VFS_REAL, and is used internally outside is boolean, True if 'relatives' contains VFS_REAL |
cd($data = '') X-Ref |
* Change current directory. This function is used to store the * current directory in a standard way, so that it may be accessed throughout phpGroupWare to provide a consistent view for the user. * To cd to the root '/', use: cd (array( 'string' => '/', 'relative' => False, 'relatives' => array (RELATIVE_NONE) )); * string Directory location to cd into. Default is '/'. * relative If set, add target to current path. Else, pass 'relative' as mask to getabsolutepath() Default is True. * relatives Relativity array (default: RELATIVE_CURRENT) |
pwd($data = '') X-Ref |
* Return current directory * * full If set, return full fake path, else just the extra dirs (False strips the leading /). Default is True. * @return String. The current directory. |
copy($data) X-Ref |
* shortcut to cp * |
move($data) X-Ref |
* shortcut to mv * |
delete($data) X-Ref |
* shortcut to rm * |
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 ""). * command_line Unix-style command line with one of the commands in the $args array * @return The return value of the actual VFS call |
default_values($data, $default_values) X-Ref |
Pas de description |
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |