Removal - obsoleted by doc/inlinedocparser.php

This commit is contained in:
Zone 2002-02-25 08:42:27 +00:00
parent 7fa1481838
commit c4feb39f23
2 changed files with 0 additions and 1272 deletions

View File

@ -1,636 +0,0 @@
\lyxformat 2.16
\textclass linuxdoc
\language default
\inputencoding latin1
\fontscheme default
\graphics default
\paperfontsize default
\spacing single
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\paperorientation portrait
\secnumdepth 2
\tocdepth 2
\paragraph_separation indent
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle default
\layout Title
\added_space_top vfill \added_space_bottom vfill
phpgwapi - VFS class
\layout Author
Jason Wies
\layout Date
June 2001
\layout Abstract
\layout Section
phpgwapi - VFS class
\layout Subsection
class vfs
\begin_inset LatexCommand \label{sec: class vfs}
\end_inset
\layout Standard
abstract: virtual file system
\layout Standard
description: Authors: Zone, Seek3r
\layout Subsection
class path_class
\begin_inset LatexCommand \label{sec: class path_class}
\end_inset
\layout Standard
abstract: helper class for path_parts
\layout Subsection
vfs
\begin_inset LatexCommand \label{sec: vfs}
\end_inset
\layout Standard
abstract: constructor, sets up variables
\layout Verbatim
function vfs ()
\layout Subsection
set_relative
\begin_inset LatexCommand \label{sec: set_relative}
\end_inset
\layout Standard
abstract: Set path relativity
\layout Standard
param: $mask Relative bitmask (see RELATIVE_ defines)
\layout Verbatim
function set_relative ($mask)
\layout Subsection
get_relative
\begin_inset LatexCommand \label{sec: get_relative}
\end_inset
\layout Standard
abstract: Return relativity bitmask
\layout Standard
discussion: Returns relativity bitmask, or the default of "completely relative" if unset
\layout Verbatim
function get_relative ()
\layout Subsection
sanitize
\begin_inset LatexCommand \label{sec: sanitize}
\end_inset
\layout Standard
abstract: Removes leading .'s from $string
\layout Standard
discussion: You should not pass all filenames through sanitize () unless you plan on rejecting\layout Standard
.files. Instead, pass the name through securitycheck () first, and if it fails,\layout Standard
pass it through sanitize
\layout Standard
param: $string string to sanitize
\layout Standard
result: $string without it's leading .'s
\layout Verbatim
function sanitize ($string)
\layout Subsection
securitycheck
\begin_inset LatexCommand \label{sec: securitycheck}
\end_inset
\layout Standard
abstract: Security check function
\layout Standard
discussion: Checks for basic violations such as ..\layout Standard
If securitycheck () fails, run your string through vfs->sanitize ()
\layout Standard
param: $string string to check security of
\layout Standard
result: Boolean True/False. True means secure, False means insecure
\layout Verbatim
function securitycheck ($string)
\layout Subsection
db_clean
\begin_inset LatexCommand \label{sec: db_clean}
\end_inset
\layout Standard
abstract: Clean $string for use in database queries
\layout Standard
param: $string String to clean
\layout Standard
result: Cleaned version of $string
\layout Verbatim
function db_clean ($string)
\layout Subsection
path_parts
\begin_inset LatexCommand \label{sec: path_parts}
\end_inset
\layout Standard
abstract: take a real or fake pathname and return an array of its component parts
\layout Standard
param: $string full real or fake path
\layout Standard
param: $relatives Relativity array
\layout Standard
param: $object True returns an object instead of an array
\layout Standard
result: $rarray/$robject Array or object containing the fake and real component parts of the path
\layout Standard
discussion: Returned values are:\layout Standard
mask\layout Standard
outside\layout Standard
fake_full_path\layout Standard
fake_leading_dirs\layout Standard
fake_extra_path\layout Standard
fake_name\layout Standard
real_full_path\layout Standard
real_leading_dirs\layout Standard
real_extra_path\layout Standard
real_name\layout Standard
fake_full_path_clean\layout Standard
fake_leading_dirs_clean\layout Standard
fake_extra_path_clean\layout Standard
fake_name_clean\layout Standard
real_full_path_clean\layout Standard
real_leading_dirs_clean\layout Standard
real_extra_path_clean\layout Standard
real_name_clean\layout Standard
"clean" values are run through vfs->db_clean () and\layout Standard
are safe for use in SQL queries that use key='value'\layout Standard
They should be used ONLY for SQL queries, so are used\layout Standard
mostly internally\layout Standard
mask is either RELATIVE_NONE or RELATIVE_NONE|VFS_REAL,\layout Standard
and is used internally\layout Standard
outside is boolean, True if $relatives contains VFS_REAL
\layout Verbatim
function path_parts ($string, $relatives = array (RELATIVE_CURRENT), $object = True)
\layout Subsection
getabsolutepath
\begin_inset LatexCommand \label{sec: getabsolutepath}
\end_inset
\layout Standard
abstract: get the absolute path
\layout Standard
param: $target defaults to False, directory/file to get path of, relative to $relatives[0]
\layout Standard
param: $mask Relativity bitmask (see RELATIVE_ defines). RELATIVE_CURRENT means use $this->relative
\layout Standard
param: $fake Returns the "fake" path, ie /home/user/dir/file (not always possible. use path_parts () instead)
\layout Standard
result: $basedir Full fake or real path
\layout Verbatim
function getabsolutepath ($target = False, $relatives = array (RELATIVE_CURRENT), $fake = True)
\layout Subsection
cd
\begin_inset LatexCommand \label{sec: cd}
\end_inset
\layout Standard
abstract: Change directory
\layout Standard
discussion: To cd to the files root "/", use cd ("/", False, array (RELATIVE_NONE));
\layout Standard
param: $target default "/". directory to cd into. if "/" and $relative is True, uses "/home/<working_lid>";
\layout Standard
param: $relative default True/relative means add target to current path, else pass $relative as mask to getabsolutepath()
\layout Verbatim
function cd ($target = "/", $relative = True, $relatives = array (RELATIVE_CURRENT))
\layout Subsection
pwd
\begin_inset LatexCommand \label{sec: pwd}
\end_inset
\layout Standard
abstract: current working dir
\layout Standard
param: $full default True returns full fake path, else just the extra dirs (false strips the leading /)
\layout Standard
result: $currentdir currentdir
\layout Verbatim
function pwd ($full = True)
\layout Subsection
read
\begin_inset LatexCommand \label{sec: read}
\end_inset
\layout Standard
abstract: return file contents
\layout Standard
param: $file filename
\layout Standard
param: $relatives Relativity array
\layout Standard
result: $contents Contents of $file, or False if file cannot be read
\layout Verbatim
function read ($file, $relatives = array (RELATIVE_CURRENT))
\layout Subsection
write
\begin_inset LatexCommand \label{sec: write}
\end_inset
\layout Standard
abstract: write to a file
\layout Standard
param: $file file name
\layout Standard
param: $relatives Relativity array
\layout Standard
param: $contents contents
\layout Standard
result: Boolean True/False
\layout Verbatim
function write ($file, $relatives = array (RELATIVE_CURRENT), $contents)
\layout Subsection
touch
\begin_inset LatexCommand \label{sec: touch}
\end_inset
\layout Standard
abstract: Create blank file $file or set the modification time and modified by of $file to current time and user
\layout Standard
param: $file File to touch or set modifies
\layout Standard
param: $relatives Relativity array
\layout Standard
result: Boolean True/False
\layout Verbatim
function touch ($file, $relatives = array (RELATIVE_CURRENT))
\layout Subsection
cp
\begin_inset LatexCommand \label{sec: cp}
\end_inset
\layout Standard
abstract: copy file
\layout Standard
param: $from from file/directory
\layout Standard
param: $to to file/directory
\layout Standard
param: $relatives Relativity array
\layout Standard
result: boolean True/False
\layout Verbatim
function cp ($from, $to, $relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT))
\layout Subsection
mv
\begin_inset LatexCommand \label{sec: mv}
\end_inset
\layout Standard
abstract: move file/directory
\layout Standard
param: $from from file/directory
\layout Standard
param: $to to file/directory
\layout Standard
param: $relatives Relativity array
\layout Standard
result: boolean True/False
\layout Verbatim
function mv ($from, $to, $relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT))
\layout Subsection
move
\begin_inset LatexCommand \label{sec: move}
\end_inset
\layout Standard
abstract: shortcut to mv
\layout Verbatim
function move ($from, $to, $relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT))
\layout Subsection
rm
\begin_inset LatexCommand \label{sec: rm}
\end_inset
\layout Standard
abstract: delete file/directory
\layout Standard
param: $string file/directory to delete
\layout Standard
param: $relatives Relativity array
\layout Standard
result: boolean True/False
\layout Verbatim
function rm ($string, $relatives = array (RELATIVE_CURRENT))
\layout Subsection
delete
\begin_inset LatexCommand \label{sec: delete}
\end_inset
\layout Standard
abstract: shortcut to rm
\layout Verbatim
function delete ($string, $relatives = array (RELATIVE_CURRENT))
\layout Subsection
mkdir
\begin_inset LatexCommand \label{sec: mkdir}
\end_inset
\layout Standard
abstract: make a new directory
\layout Standard
param: $dir Directory name
\layout Standard
param: $relatives Relativity array
\layout Standard
result: boolean True on success
\layout Verbatim
function mkdir ($dir, $relatives = array (RELATIVE_CURRENT))
\layout Subsection
set_attributes
\begin_inset LatexCommand \label{sec: set_attributes}
\end_inset
\layout Standard
abstract: Update database entry for $file with the attributes in $attributes
\layout Standard
param: $file file/directory to update
\layout Standard
param: $relatives Relativity array
\layout Standard
param: $attributes keyed array of attributes. key is attribute name, value is attribute value
\layout Standard
result: Boolean True/False
\layout Standard
discussion: Valid attributes are:\layout Standard
owner_id\layout Standard
createdby_id\layout Standard
modifiedby_id\layout Standard
created\layout Standard
modified\layout Standard
size\layout Standard
mime_type\layout Standard
deleteable\layout Standard
comment\layout Standard
app
\layout Verbatim
function set_attributes ($file, $relatives = array (RELATIVE_CURRENT), $attributes = array ())
\layout Subsection
correct_attributes
\begin_inset LatexCommand \label{sec: correct_attributes}
\end_inset
\layout Standard
abstract: Set the correct attributes for $string (e.g. owner)
\layout Standard
param: $string File/directory to correct attributes of
\layout Standard
param: $relatives Relativity array
\layout Standard
result: Boolean True/False
\layout Verbatim
function correct_attributes ($string, $relatives = array (RELATIVE_CURRENT))
\layout Subsection
file_type
\begin_inset LatexCommand \label{sec: file_type}
\end_inset
\layout Standard
abstract: return file/dir type (MIME or other)
\layout Standard
param: $file File or directory path (/home/user/dir/dir2/dir3, /home/user/dir/dir2/file)
\layout Standard
param: $relatives Relativity array
\layout Standard
result: MIME type, "Directory", or nothing if MIME type is not known
\layout Verbatim
function file_type ($file, $relatives = array (RELATIVE_CURRENT))
\layout Subsection
file_exists
\begin_inset LatexCommand \label{sec: file_exists}
\end_inset
\layout Standard
abstract: check if file/directory exists
\layout Standard
param: $string file/directory to check existance of
\layout Standard
param: $relatives Relativity array
\layout Standard
result: Boolean True/False
\layout Verbatim
function file_exists ($string, $relatives = array (RELATIVE_CURRENT))
\layout Subsection
checkperms
\begin_inset LatexCommand \label{sec: checkperms}
\end_inset
\layout Standard
abstract: Check if you have write access to create files in $dir
\layout Standard
discussion: This isn't perfect, because vfs->touch () returns True even\layout Standard
if only the database entry worked. ACLs need to be\layout Standard
implemented for better permission checking. It's\layout Standard
also pretty slow, so I wouldn't recommend using it\layout Standard
often
\layout Standard
param: $dir Directory to check access of
\layout Standard
param: $relatives Relativity array
\layout Standard
result: Boolean True/False
\layout Verbatim
function checkperms ($dir, $relatives = array (RELATIVE_CURRENT))
\layout Subsection
ls
\begin_inset LatexCommand \label{sec: ls}
\end_inset
\layout Standard
abstract: get directory listing
\layout Standard
discussion: Note: the entries are not guaranteed to be returned in any logical order
\layout Standard
param: $dir Directory
\layout Standard
param: $relatives Relativity array
\layout Standard
param: $checksubdirs Boolean, recursively list all sub directories as well?
\layout Standard
param: $mime_type Only return entries matching MIME-type $mime_type. Can be "Directory" or "\ " for those without MIME types
\layout Standard
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'
\layout Standard
result: array of arrays. Subarrays contain full info for each file/dir.
\layout Verbatim
function ls ($dir = False, $relatives = array (RELATIVE_CURRENT), $checksubdirs = True, $mime_type = False, $nofiles = False)
\layout Subsection
dir
\begin_inset LatexCommand \label{sec: dir}
\end_inset
\layout Standard
abstract: shortcut to ls
\layout Verbatim
function dir ($dir = False, $relatives = array (RELATIVE_CURRENT), $checksubdirs = True, $mime_type = False, $nofiles = False)
\the_end

View File

@ -1,636 +0,0 @@
<!doctype linuxdoc system>
<!-- LyX 1.1 created this file. For more info see http://www.lyx.org/ -->
<article>
<title>
phpgwapi - VFS class
</title>
<author>
Jason Wies
</author>
<date>
June 2001
</date>
<abstract>
</abstract>
<sect>
phpgwapi - VFS class
<sect1>
class vfs<label id="sec: class vfs" >
<p>
abstract: virtual file system
</p>
<p>
description: Authors: Zone, Seek3r
</p>
<sect1>
class path_class<label id="sec: class path_class" >
<p>
abstract: helper class for path_parts
</p>
<sect1>
vfs<label id="sec: vfs" >
<p>
abstract: constructor, sets up variables
</p>
<p>
<verb>
function vfs ()
</verb>
</p><sect1>
set_relative<label id="sec: set_relative" >
<p>
abstract: Set path relativity
</p>
<p>
param: &dollar;mask Relative bitmask (see RELATIVE_ defines)
</p>
<p>
<verb>
function set_relative (&dollar;mask)
</verb>
</p><sect1>
get_relative<label id="sec: get_relative" >
<p>
abstract: Return relativity bitmask
</p>
<p>
discussion: Returns relativity bitmask, or the default of &quot;completely
relative&quot; if unset
</p>
<p>
<verb>
function get_relative ()
</verb>
</p><sect1>
sanitize<label id="sec: sanitize" >
<p>
abstract: Removes leading .'s from &dollar;string
</p>
<p>
discussion: You should not pass all filenames through sanitize () unless
you plan on rejecting
</p>
<p>
.files. Instead, pass the name through securitycheck () first, and if
it fails,
</p>
<p>
pass it through sanitize
</p>
<p>
param: &dollar;string string to sanitize
</p>
<p>
result: &dollar;string without it's leading .'s
</p>
<p>
<verb>
function sanitize (&dollar;string)
</verb>
</p><sect1>
securitycheck<label id="sec: securitycheck" >
<p>
abstract: Security check function
</p>
<p>
discussion: Checks for basic violations such as ..
</p>
<p>
If securitycheck () fails, run your string through vfs-&gt;sanitize ()
</p>
<p>
param: &dollar;string string to check security of
</p>
<p>
result: Boolean True/False. True means secure, False means insecure
</p>
<p>
<verb>
function securitycheck (&dollar;string)
</verb>
</p><sect1>
db_clean<label id="sec: db_clean" >
<p>
abstract: Clean &dollar;string for use in database queries
</p>
<p>
param: &dollar;string String to clean
</p>
<p>
result: Cleaned version of &dollar;string
</p>
<p>
<verb>
function db_clean (&dollar;string)
</verb>
</p><sect1>
path_parts<label id="sec: path_parts" >
<p>
abstract: take a real or fake pathname and return an array of its component
parts
</p>
<p>
param: &dollar;string full real or fake path
</p>
<p>
param: &dollar;relatives Relativity array
</p>
<p>
param: &dollar;object True returns an object instead of an array
</p>
<p>
result: &dollar;rarray/&dollar;robject Array or object containing the fake
and real component parts of the path
</p>
<p>
discussion: Returned values are:
</p>
<p>
mask
</p>
<p>
outside
</p>
<p>
fake_full_path
</p>
<p>
fake_leading_dirs
</p>
<p>
fake_extra_path
</p>
<p>
fake_name
</p>
<p>
real_full_path
</p>
<p>
real_leading_dirs
</p>
<p>
real_extra_path
</p>
<p>
real_name
</p>
<p>
fake_full_path_clean
</p>
<p>
fake_leading_dirs_clean
</p>
<p>
fake_extra_path_clean
</p>
<p>
fake_name_clean
</p>
<p>
real_full_path_clean
</p>
<p>
real_leading_dirs_clean
</p>
<p>
real_extra_path_clean
</p>
<p>
real_name_clean
</p>
<p>
&quot;clean&quot; values are run through vfs-&gt;db_clean () and
</p>
<p>
are safe for use in SQL queries that use key='value'
</p>
<p>
They should be used ONLY for SQL queries, so are used
</p>
<p>
mostly internally
</p>
<p>
mask is either RELATIVE_NONE or RELATIVE_NONE|VFS_REAL,
</p>
<p>
and is used internally
</p>
<p>
outside is boolean, True if &dollar;relatives contains VFS_REAL
</p>
<p>
<verb>
function path_parts (&dollar;string, &dollar;relatives = array (RELATIVE_CURRENT), &dollar;object = True)
</verb>
</p><sect1>
getabsolutepath<label id="sec: getabsolutepath" >
<p>
abstract: get the absolute path
</p>
<p>
param: &dollar;target defaults to False, directory/file to get path of,
relative to &dollar;relatives&lsqb;0&rsqb;
</p>
<p>
param: &dollar;mask Relativity bitmask (see RELATIVE_ defines). RELATIVE_CURRENT
means use &dollar;this-&gt;relative
</p>
<p>
param: &dollar;fake Returns the &quot;fake&quot; path, ie /home/user/dir/file
(not always possible. use path_parts () instead)
</p>
<p>
result: &dollar;basedir Full fake or real path
</p>
<p>
<verb>
function getabsolutepath (&dollar;target = False, &dollar;relatives = array (RELATIVE_CURRENT), &dollar;fake = True)
</verb>
</p><sect1>
cd<label id="sec: cd" >
<p>
abstract: Change directory
</p>
<p>
discussion: To cd to the files root &quot;/&quot;, use cd (&quot;/&quot;,
False, array (RELATIVE_NONE));
</p>
<p>
param: &dollar;target default &quot;/&quot;. directory to cd into. if
&quot;/&quot; and &dollar;relative is True, uses &quot;/home/&lt;working_lid&gt;&quot;;
</p>
<p>
param: &dollar;relative default True/relative means add target to current
path, else pass &dollar;relative as mask to getabsolutepath()
</p>
<p>
<verb>
function cd (&dollar;target = &quot;/&quot;, &dollar;relative = True, &dollar;relatives = array (RELATIVE_CURRENT))
</verb>
</p><sect1>
pwd<label id="sec: pwd" >
<p>
abstract: current working dir
</p>
<p>
param: &dollar;full default True returns full fake path, else just the
extra dirs (false strips the leading /)
</p>
<p>
result: &dollar;currentdir currentdir
</p>
<p>
<verb>
function pwd (&dollar;full = True)
</verb>
</p><sect1>
read<label id="sec: read" >
<p>
abstract: return file contents
</p>
<p>
param: &dollar;file filename
</p>
<p>
param: &dollar;relatives Relativity array
</p>
<p>
result: &dollar;contents Contents of &dollar;file, or False if file cannot
be read
</p>
<p>
<verb>
function read (&dollar;file, &dollar;relatives = array (RELATIVE_CURRENT))
</verb>
</p><sect1>
write<label id="sec: write" >
<p>
abstract: write to a file
</p>
<p>
param: &dollar;file file name
</p>
<p>
param: &dollar;relatives Relativity array
</p>
<p>
param: &dollar;contents contents
</p>
<p>
result: Boolean True/False
</p>
<p>
<verb>
function write (&dollar;file, &dollar;relatives = array (RELATIVE_CURRENT), &dollar;contents)
</verb>
</p><sect1>
touch<label id="sec: touch" >
<p>
abstract: Create blank file &dollar;file or set the modification time and
modified by of &dollar;file to current time and user
</p>
<p>
param: &dollar;file File to touch or set modifies
</p>
<p>
param: &dollar;relatives Relativity array
</p>
<p>
result: Boolean True/False
</p>
<p>
<verb>
function touch (&dollar;file, &dollar;relatives = array (RELATIVE_CURRENT))
</verb>
</p><sect1>
cp<label id="sec: cp" >
<p>
abstract: copy file
</p>
<p>
param: &dollar;from from file/directory
</p>
<p>
param: &dollar;to to file/directory
</p>
<p>
param: &dollar;relatives Relativity array
</p>
<p>
result: boolean True/False
</p>
<p>
<verb>
function cp (&dollar;from, &dollar;to, &dollar;relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT))
</verb>
</p><sect1>
mv<label id="sec: mv" >
<p>
abstract: move file/directory
</p>
<p>
param: &dollar;from from file/directory
</p>
<p>
param: &dollar;to to file/directory
</p>
<p>
param: &dollar;relatives Relativity array
</p>
<p>
result: boolean True/False
</p>
<p>
<verb>
function mv (&dollar;from, &dollar;to, &dollar;relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT))
</verb>
</p><sect1>
move<label id="sec: move" >
<p>
abstract: shortcut to mv
</p>
<p>
<verb>
function move (&dollar;from, &dollar;to, &dollar;relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT))
</verb>
</p><sect1>
rm<label id="sec: rm" >
<p>
abstract: delete file/directory
</p>
<p>
param: &dollar;string file/directory to delete
</p>
<p>
param: &dollar;relatives Relativity array
</p>
<p>
result: boolean True/False
</p>
<p>
<verb>
function rm (&dollar;string, &dollar;relatives = array (RELATIVE_CURRENT))
</verb>
</p><sect1>
delete<label id="sec: delete" >
<p>
abstract: shortcut to rm
</p>
<p>
<verb>
function delete (&dollar;string, &dollar;relatives = array (RELATIVE_CURRENT))
</verb>
</p><sect1>
mkdir<label id="sec: mkdir" >
<p>
abstract: make a new directory
</p>
<p>
param: &dollar;dir Directory name
</p>
<p>
param: &dollar;relatives Relativity array
</p>
<p>
result: boolean True on success
</p>
<p>
<verb>
function mkdir (&dollar;dir, &dollar;relatives = array (RELATIVE_CURRENT))
</verb>
</p><sect1>
set_attributes<label id="sec: set_attributes" >
<p>
abstract: Update database entry for &dollar;file with the attributes in
&dollar;attributes
</p>
<p>
param: &dollar;file file/directory to update
</p>
<p>
param: &dollar;relatives Relativity array
</p>
<p>
param: &dollar;attributes keyed array of attributes. key is attribute
name, value is attribute value
</p>
<p>
result: Boolean True/False
</p>
<p>
discussion: Valid attributes are:
</p>
<p>
owner_id
</p>
<p>
createdby_id
</p>
<p>
modifiedby_id
</p>
<p>
created
</p>
<p>
modified
</p>
<p>
size
</p>
<p>
mime_type
</p>
<p>
deleteable
</p>
<p>
comment
</p>
<p>
app
</p>
<p>
<verb>
function set_attributes (&dollar;file, &dollar;relatives = array (RELATIVE_CURRENT), &dollar;attributes = array ())
</verb>
</p><sect1>
correct_attributes<label id="sec: correct_attributes" >
<p>
abstract: Set the correct attributes for &dollar;string (e.g. owner)
</p>
<p>
param: &dollar;string File/directory to correct attributes of
</p>
<p>
param: &dollar;relatives Relativity array
</p>
<p>
result: Boolean True/False
</p>
<p>
<verb>
function correct_attributes (&dollar;string, &dollar;relatives = array (RELATIVE_CURRENT))
</verb>
</p><sect1>
file_type<label id="sec: file_type" >
<p>
abstract: return file/dir type (MIME or other)
</p>
<p>
param: &dollar;file File or directory path (/home/user/dir/dir2/dir3, /home/user/dir/dir2/file)
</p>
<p>
param: &dollar;relatives Relativity array
</p>
<p>
result: MIME type, &quot;Directory&quot;, or nothing if MIME type is not
known
</p>
<p>
<verb>
function file_type (&dollar;file, &dollar;relatives = array (RELATIVE_CURRENT))
</verb>
</p><sect1>
file_exists<label id="sec: file_exists" >
<p>
abstract: check if file/directory exists
</p>
<p>
param: &dollar;string file/directory to check existance of
</p>
<p>
param: &dollar;relatives Relativity array
</p>
<p>
result: Boolean True/False
</p>
<p>
<verb>
function file_exists (&dollar;string, &dollar;relatives = array (RELATIVE_CURRENT))
</verb>
</p><sect1>
checkperms<label id="sec: checkperms" >
<p>
abstract: Check if you have write access to create files in &dollar;dir
</p>
<p>
discussion: This isn't perfect, because vfs-&gt;touch () returns True even
</p>
<p>
if only the database entry worked. ACLs need to be
</p>
<p>
implemented for better permission checking. It's
</p>
<p>
also pretty slow, so I wouldn't recommend using it
</p>
<p>
often
</p>
<p>
param: &dollar;dir Directory to check access of
</p>
<p>
param: &dollar;relatives Relativity array
</p>
<p>
result: Boolean True/False
</p>
<p>
<verb>
function checkperms (&dollar;dir, &dollar;relatives = array (RELATIVE_CURRENT))
</verb>
</p><sect1>
ls<label id="sec: ls" >
<p>
abstract: get directory listing
</p>
<p>
discussion: Note: the entries are not guaranteed to be returned in any
logical order
</p>
<p>
param: &dollar;dir Directory
</p>
<p>
param: &dollar;relatives Relativity array
</p>
<p>
param: &dollar;checksubdirs Boolean, recursively list all sub directories
as well?
</p>
<p>
param: &dollar;mime_type Only return entries matching MIME-type &dollar;mime_type.
Can be &quot;Directory&quot; or &quot;&bsol;&quot; for those without MIME
types
</p>
<p>
param: &dollar;nofiles Boolean. True means you want to return just the
information about the directory &dollar;dir. If &dollar;dir is a file, &dollar;nofiles
is implied. This is the equivalent of 'ls -ld &dollar;dir'
</p>
<p>
result: array of arrays. Subarrays contain full info for each file/dir.
</p>
<p>
<verb>
function ls (&dollar;dir = False, &dollar;relatives = array (RELATIVE_CURRENT), &dollar;checksubdirs = True, &dollar;mime_type = False, &dollar;nofiles = False)
</verb>
</p><sect1>
dir<label id="sec: dir" >
<p>
abstract: shortcut to ls
</p>
<p>
<verb>
function dir (&dollar;dir = False, &dollar;relatives = array (RELATIVE_CURRENT), &dollar;checksubdirs = True, &dollar;mime_type = False, &dollar;nofiles = False)
</verb>
</article>