mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-14 01:48:35 +01:00
Removal - obsoleted by doc/inlinedocparser.php
This commit is contained in:
parent
7fa1481838
commit
c4feb39f23
@ -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
|
@ -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: $mask Relative bitmask (see RELATIVE_ defines)
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function set_relative ($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 "completely
|
||||
relative" if unset
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function get_relative ()
|
||||
</verb>
|
||||
</p><sect1>
|
||||
sanitize<label id="sec: sanitize" >
|
||||
<p>
|
||||
abstract: Removes leading .'s from $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: $string string to sanitize
|
||||
</p>
|
||||
<p>
|
||||
result: $string without it's leading .'s
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function sanitize ($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->sanitize ()
|
||||
</p>
|
||||
<p>
|
||||
param: $string string to check security of
|
||||
</p>
|
||||
<p>
|
||||
result: Boolean True/False. True means secure, False means insecure
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function securitycheck ($string)
|
||||
</verb>
|
||||
</p><sect1>
|
||||
db_clean<label id="sec: db_clean" >
|
||||
<p>
|
||||
abstract: Clean $string for use in database queries
|
||||
</p>
|
||||
<p>
|
||||
param: $string String to clean
|
||||
</p>
|
||||
<p>
|
||||
result: Cleaned version of $string
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function db_clean ($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: $string full real or fake path
|
||||
</p>
|
||||
<p>
|
||||
param: $relatives Relativity array
|
||||
</p>
|
||||
<p>
|
||||
param: $object True returns an object instead of an array
|
||||
</p>
|
||||
<p>
|
||||
result: $rarray/$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>
|
||||
"clean" values are run through vfs->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 $relatives contains VFS_REAL
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function path_parts ($string, $relatives = array (RELATIVE_CURRENT), $object = True)
|
||||
</verb>
|
||||
</p><sect1>
|
||||
getabsolutepath<label id="sec: getabsolutepath" >
|
||||
<p>
|
||||
abstract: get the absolute path
|
||||
</p>
|
||||
<p>
|
||||
param: $target defaults to False, directory/file to get path of,
|
||||
relative to $relatives[0]
|
||||
</p>
|
||||
<p>
|
||||
param: $mask Relativity bitmask (see RELATIVE_ defines). RELATIVE_CURRENT
|
||||
means use $this->relative
|
||||
</p>
|
||||
<p>
|
||||
param: $fake Returns the "fake" path, ie /home/user/dir/file
|
||||
(not always possible. use path_parts () instead)
|
||||
</p>
|
||||
<p>
|
||||
result: $basedir Full fake or real path
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function getabsolutepath ($target = False, $relatives = array (RELATIVE_CURRENT), $fake = True)
|
||||
</verb>
|
||||
</p><sect1>
|
||||
cd<label id="sec: cd" >
|
||||
<p>
|
||||
abstract: Change directory
|
||||
</p>
|
||||
<p>
|
||||
discussion: To cd to the files root "/", use cd ("/",
|
||||
False, array (RELATIVE_NONE));
|
||||
</p>
|
||||
<p>
|
||||
param: $target default "/". directory to cd into. if
|
||||
"/" and $relative is True, uses "/home/<working_lid>";
|
||||
</p>
|
||||
<p>
|
||||
param: $relative default True/relative means add target to current
|
||||
path, else pass $relative as mask to getabsolutepath()
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function cd ($target = "/", $relative = True, $relatives = array (RELATIVE_CURRENT))
|
||||
</verb>
|
||||
</p><sect1>
|
||||
pwd<label id="sec: pwd" >
|
||||
<p>
|
||||
abstract: current working dir
|
||||
</p>
|
||||
<p>
|
||||
param: $full default True returns full fake path, else just the
|
||||
extra dirs (false strips the leading /)
|
||||
</p>
|
||||
<p>
|
||||
result: $currentdir currentdir
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function pwd ($full = True)
|
||||
</verb>
|
||||
</p><sect1>
|
||||
read<label id="sec: read" >
|
||||
<p>
|
||||
abstract: return file contents
|
||||
</p>
|
||||
<p>
|
||||
param: $file filename
|
||||
</p>
|
||||
<p>
|
||||
param: $relatives Relativity array
|
||||
</p>
|
||||
<p>
|
||||
result: $contents Contents of $file, or False if file cannot
|
||||
be read
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function read ($file, $relatives = array (RELATIVE_CURRENT))
|
||||
</verb>
|
||||
</p><sect1>
|
||||
write<label id="sec: write" >
|
||||
<p>
|
||||
abstract: write to a file
|
||||
</p>
|
||||
<p>
|
||||
param: $file file name
|
||||
</p>
|
||||
<p>
|
||||
param: $relatives Relativity array
|
||||
</p>
|
||||
<p>
|
||||
param: $contents contents
|
||||
</p>
|
||||
<p>
|
||||
result: Boolean True/False
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function write ($file, $relatives = array (RELATIVE_CURRENT), $contents)
|
||||
</verb>
|
||||
</p><sect1>
|
||||
touch<label id="sec: touch" >
|
||||
<p>
|
||||
abstract: Create blank file $file or set the modification time and
|
||||
modified by of $file to current time and user
|
||||
</p>
|
||||
<p>
|
||||
param: $file File to touch or set modifies
|
||||
</p>
|
||||
<p>
|
||||
param: $relatives Relativity array
|
||||
</p>
|
||||
<p>
|
||||
result: Boolean True/False
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function touch ($file, $relatives = array (RELATIVE_CURRENT))
|
||||
</verb>
|
||||
</p><sect1>
|
||||
cp<label id="sec: cp" >
|
||||
<p>
|
||||
abstract: copy file
|
||||
</p>
|
||||
<p>
|
||||
param: $from from file/directory
|
||||
</p>
|
||||
<p>
|
||||
param: $to to file/directory
|
||||
</p>
|
||||
<p>
|
||||
param: $relatives Relativity array
|
||||
</p>
|
||||
<p>
|
||||
result: boolean True/False
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function cp ($from, $to, $relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT))
|
||||
</verb>
|
||||
</p><sect1>
|
||||
mv<label id="sec: mv" >
|
||||
<p>
|
||||
abstract: move file/directory
|
||||
</p>
|
||||
<p>
|
||||
param: $from from file/directory
|
||||
</p>
|
||||
<p>
|
||||
param: $to to file/directory
|
||||
</p>
|
||||
<p>
|
||||
param: $relatives Relativity array
|
||||
</p>
|
||||
<p>
|
||||
result: boolean True/False
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function mv ($from, $to, $relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT))
|
||||
</verb>
|
||||
</p><sect1>
|
||||
move<label id="sec: move" >
|
||||
<p>
|
||||
abstract: shortcut to mv
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function move ($from, $to, $relatives = array (RELATIVE_CURRENT, RELATIVE_CURRENT))
|
||||
</verb>
|
||||
</p><sect1>
|
||||
rm<label id="sec: rm" >
|
||||
<p>
|
||||
abstract: delete file/directory
|
||||
</p>
|
||||
<p>
|
||||
param: $string file/directory to delete
|
||||
</p>
|
||||
<p>
|
||||
param: $relatives Relativity array
|
||||
</p>
|
||||
<p>
|
||||
result: boolean True/False
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function rm ($string, $relatives = array (RELATIVE_CURRENT))
|
||||
</verb>
|
||||
</p><sect1>
|
||||
delete<label id="sec: delete" >
|
||||
<p>
|
||||
abstract: shortcut to rm
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function delete ($string, $relatives = array (RELATIVE_CURRENT))
|
||||
</verb>
|
||||
</p><sect1>
|
||||
mkdir<label id="sec: mkdir" >
|
||||
<p>
|
||||
abstract: make a new directory
|
||||
</p>
|
||||
<p>
|
||||
param: $dir Directory name
|
||||
</p>
|
||||
<p>
|
||||
param: $relatives Relativity array
|
||||
</p>
|
||||
<p>
|
||||
result: boolean True on success
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function mkdir ($dir, $relatives = array (RELATIVE_CURRENT))
|
||||
</verb>
|
||||
</p><sect1>
|
||||
set_attributes<label id="sec: set_attributes" >
|
||||
<p>
|
||||
abstract: Update database entry for $file with the attributes in
|
||||
$attributes
|
||||
</p>
|
||||
<p>
|
||||
param: $file file/directory to update
|
||||
</p>
|
||||
<p>
|
||||
param: $relatives Relativity array
|
||||
</p>
|
||||
<p>
|
||||
param: $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 ($file, $relatives = array (RELATIVE_CURRENT), $attributes = array ())
|
||||
</verb>
|
||||
</p><sect1>
|
||||
correct_attributes<label id="sec: correct_attributes" >
|
||||
<p>
|
||||
abstract: Set the correct attributes for $string (e.g. owner)
|
||||
</p>
|
||||
<p>
|
||||
param: $string File/directory to correct attributes of
|
||||
</p>
|
||||
<p>
|
||||
param: $relatives Relativity array
|
||||
</p>
|
||||
<p>
|
||||
result: Boolean True/False
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function correct_attributes ($string, $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: $file File or directory path (/home/user/dir/dir2/dir3, /home/user/dir/dir2/file)
|
||||
</p>
|
||||
<p>
|
||||
param: $relatives Relativity array
|
||||
</p>
|
||||
<p>
|
||||
result: MIME type, "Directory", or nothing if MIME type is not
|
||||
known
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function file_type ($file, $relatives = array (RELATIVE_CURRENT))
|
||||
</verb>
|
||||
</p><sect1>
|
||||
file_exists<label id="sec: file_exists" >
|
||||
<p>
|
||||
abstract: check if file/directory exists
|
||||
</p>
|
||||
<p>
|
||||
param: $string file/directory to check existance of
|
||||
</p>
|
||||
<p>
|
||||
param: $relatives Relativity array
|
||||
</p>
|
||||
<p>
|
||||
result: Boolean True/False
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function file_exists ($string, $relatives = array (RELATIVE_CURRENT))
|
||||
</verb>
|
||||
</p><sect1>
|
||||
checkperms<label id="sec: checkperms" >
|
||||
<p>
|
||||
abstract: Check if you have write access to create files in $dir
|
||||
</p>
|
||||
<p>
|
||||
discussion: This isn't perfect, because vfs->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: $dir Directory to check access of
|
||||
</p>
|
||||
<p>
|
||||
param: $relatives Relativity array
|
||||
</p>
|
||||
<p>
|
||||
result: Boolean True/False
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function checkperms ($dir, $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: $dir Directory
|
||||
</p>
|
||||
<p>
|
||||
param: $relatives Relativity array
|
||||
</p>
|
||||
<p>
|
||||
param: $checksubdirs Boolean, recursively list all sub directories
|
||||
as well?
|
||||
</p>
|
||||
<p>
|
||||
param: $mime_type Only return entries matching MIME-type $mime_type.
|
||||
Can be "Directory" or "\" for those without MIME
|
||||
types
|
||||
</p>
|
||||
<p>
|
||||
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'
|
||||
</p>
|
||||
<p>
|
||||
result: array of arrays. Subarrays contain full info for each file/dir.
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function ls ($dir = False, $relatives = array (RELATIVE_CURRENT), $checksubdirs = True, $mime_type = False, $nofiles = False)
|
||||
</verb>
|
||||
</p><sect1>
|
||||
dir<label id="sec: dir" >
|
||||
<p>
|
||||
abstract: shortcut to ls
|
||||
</p>
|
||||
<p>
|
||||
<verb>
|
||||
function dir ($dir = False, $relatives = array (RELATIVE_CURRENT), $checksubdirs = True, $mime_type = False, $nofiles = False)
|
||||
</verb>
|
||||
|
||||
|
||||
</article>
|
Loading…
Reference in New Issue
Block a user