source: companies/celepar/phpgwapi/doc/vfs/vfs-6.html @ 763

Revision 763, 4.3 KB checked in by niltonneto, 15 years ago (diff)

Importação inicial do Expresso da Celepar

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2<HTML>
3<HEAD>
4 <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.17">
5 <TITLE>phpgwapi - VFS Class: Notes</TITLE>
6 <LINK HREF="vfs-7.html" REL=next>
7 <LINK HREF="vfs-5.html" REL=previous>
8 <LINK HREF="vfs.html#toc6" REL=contents>
9</HEAD>
10<BODY>
11<A HREF="vfs-7.html">Next</A>
12<A HREF="vfs-5.html">Previous</A>
13<A HREF="vfs.html#toc6">Contents</A>
14<HR>
15<H2><A NAME="sec:notes"></A> <A NAME="s6">6.</A> <A HREF="vfs.html#toc6">Notes</A></H2>
16
17<H2><A NAME="sec:database"></A> <A NAME="ss6.1">6.1</A> <A HREF="vfs.html#toc6.1">Database</A>
18</H2>
19
20<P>Data about the files and directories within the virtual root
21is kept in the SQL database. Currently, this information includes:</P>
22<P>
23<UL>
24<LI>File ID (used internally, primary key for table)</LI>
25<LI>Owner ID (phpGW account_id)</LI>
26<LI>Created by ID (phpGW account_id)</LI>
27<LI>Modified by ID (phpGW account_id)</LI>
28<LI>Created (date)</LI>
29<LI>Modified (date)</LI>
30<LI>Size (bytes)</LI>
31<LI>MIME type</LI>
32<LI>Deleteable (Y/N/Other?)</LI>
33<LI>Comment</LI>
34<LI>App (appname of application that created the file)</LI>
35<LI>Directory (directory the file or directory is in)</LI>
36<LI>Name (name of file or directory)</LI>
37<LI>Link directory (if the file or directory is linked, what the
38actual directory is)</LI>
39<LI>Link name (if the file or directory is linked, what the actual
40name is)</LI>
41<LI>Version (numeric version of the file)</LI>
42</UL>
43</P>
44<P>The internal names of these (the database column names) are stored
45in the $GLOBALS['phpgw']-&gt;vfs-&gt;attributes
46array, which is useful for loops, and is guaranteed to be up-to-date.</P>
47<P>Note that no information is kept about files outside the virtual
48root. If a file is moved outside, all records of it are deleted from
49the database (other than the journaling records). If a file is moved
50into the virtual root, some information, specifically MIME-type,
51is not always stored in the database. The vital information has defaults:
52owner is based on where the file is being stored; size is correctly
53read; deleteable is set to Y.</P>
54<H2><A NAME="sec:acl_support"></A> <A NAME="ss6.2">6.2</A> <A HREF="vfs.html#toc6.2">ACL support</A>
55</H2>
56
57<P>ACL support is built into the VFS. vfs-&gt;acl_check () does
58the actual checking, and is called from all VFS functions as needed.
59If the file or directory sent to acl_check () doesn't exist, the
60permissions for the parent directory are used to determine access.
61ACL checking can be overridden at any time by setting vfs-&gt;override_acl.
62For example:</P>
63<P>
64<PRE>
65$GLOBALS['phpgw']-&gt;vfs-&gt;override_acl = 1;
66$GLOBALS['phpgw']-&gt;vfs-&gt;mkdir (array(
67     'string' =&gt; $GLOBALS['fakebase']. '/' . $group_array['account_name'],
68     'relatives' =&gt; array(
69          RELATIVE_NONE
70     )
71));
72$GLOBALS['phpgw']-&gt;vfs-&gt;override_acl = 0;
73</PRE>
74</P>
75<H2><A NAME="sec:function_aliases"></A> <A NAME="ss6.3">6.3</A> <A HREF="vfs.html#toc6.3">Function aliases</A>
76</H2>
77
78<P>You might have noticed there are some functions that just pass
79the arguments on to other functions. These are provided in part because
80of legacy and in part for convenience. You can use either. Here is
81the list (alias -&gt; actual):</P>
82<P>
83<UL>
84<LI>copy -&gt; cp</LI>
85<LI>move -&gt; rm</LI>
86<LI>delete -&gt; rm</LI>
87<LI>dir -&gt; ls</LI>
88</UL>
89</P>
90<H2><A NAME="sec:fakebase"></A> <A NAME="ss6.4">6.4</A> <A HREF="vfs.html#toc6.4">Fakebase directory (changing /home)</A>
91</H2>
92
93<P>The old VFS was hard-coded to use '/home' as the fake base directory,
94even though the user never saw it. With the new system, crafty administrators
95may wish to change '/home' to something else, say '/users' or '/public_html'.
96The fake base directory name is stored in $GLOBALS['phpgw']-&gt;vfs-&gt;fakebase,
97and changing it will transparently change it throughout the VFS and
98all applications. However, this must be done <EM>before</EM> any data is in
99the VFS database. If you wish to change it afterwords, you'll have
100to manually update the database, replacing the old value with the
101new value. <EM>Application programmers need to recognize that /home is
102not absolute, and use $GLOBALS['phpgw']-&gt;vfs-&gt;fakebase
103instead</EM>. I suggest setting $fakebase = $GLOBALS['phpgw']-&gt;vfs-&gt;fakebase;
104right off the bat to keep things neater.</P>
105<HR>
106<A HREF="vfs-7.html">Next</A>
107<A HREF="vfs-5.html">Previous</A>
108<A HREF="vfs.html#toc6">Contents</A>
109</BODY>
110</HTML>
Note: See TracBrowser for help on using the repository browser.