source: trunk/phpgwapi/inc/adodb/session/adodb-sess.txt @ 2

Revision 2, 3.7 KB checked in by niltonneto, 17 years ago (diff)

Removida todas as tags usadas pelo CVS ($Id, $Source).
Primeira versão no CVS externo.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1John,
2
3I have been an extremely satisfied ADODB user for several years now.
4
5To give you something back for all your hard work, I've spent the last 3
6days rewriting the adodb-session.php code.
7
8----------
9What's New
10----------
11
12Here's a list of the new code's benefits:
13
14* Combines the functionality of the three files:
15
16adodb-session.php
17adodb-session-clob.php
18adodb-cryptsession.php
19
20each with very similar functionality, into a single file adodb-session.php.
21This will ease maintenance and support issues.
22
23* Supports multiple encryption and compression schemes.
24  Currently, we support:
25
26  MD5Crypt (crypt.inc.php)
27  MCrypt
28  Secure (Horde's emulation of MCrypt, if MCrypt module is not available.)
29  GZip
30  BZip2
31
32These can be stacked, so if you want to compress and then encrypt your
33session data, it's easy.
34Also, the built-in MCrypt functions will be *much* faster, and more secure,
35than the MD5Crypt code.
36
37* adodb-session.php contains a single class ADODB_Session that encapsulates
38all functionality.
39  This eliminates the use of global vars and defines (though they are
40supported for backwards compatibility).
41
42* All user defined parameters are now static functions in the ADODB_Session
43class.
44
45New parameters include:
46
47* encryptionKey(): Define the encryption key used to encrypt the session.
48Originally, it was a hard coded string.
49
50* persist(): Define if the database will be opened in persistent mode.
51Originally, the user had to call adodb_sess_open().
52
53* dataFieldName(): Define the field name used to store the session data, as
54'DATA' appears to be a reserved word in the following cases:
55        ANSI SQL
56        IBM DB2
57        MS SQL Server
58        Postgres
59        SAP
60
61* filter(): Used to support multiple, simulataneous encryption/compression
62schemes.
63
64* Debug support is improved thru _rsdump() function, which is called after
65every database call.
66
67------------
68What's Fixed
69------------
70
71The new code includes several bug fixes and enhancements:
72
73* sesskey is compared in BINARY mode for MySQL, to avoid problems with
74session keys that differ only by case.
75  Of course, the user should define the sesskey field as BINARY, to
76correctly fix this problem, otherwise performance will suffer.
77
78* In ADODB_Session::gc(), if $expire_notify is true, the multiple DELETES in
79the original code have been optimized to a single DELETE.
80
81* In ADODB_Session::destroy(), since "SELECT expireref, sesskey FROM $table
82WHERE sesskey = $qkey" will only return a single value, we don't loop on the
83result, we simply process the row, if any.
84
85* We close $rs after every use.
86
87---------------
88What's the Same
89---------------
90
91I know backwards compatibility is *very* important to you.  Therefore, the
92new code is 100% backwards compatible.
93
94If you like my code, but don't "trust" it's backwards compatible, maybe we
95offer it as beta code, in a new directory for a release or two?
96
97------------
98What's To Do
99------------
100
101I've vascillated over whether to use a single function to get/set
102parameters:
103
104$user = ADODB_Session::user();  // get
105ADODB_Session::user($user);             // set
106
107or to use separate functions (which is the PEAR/Java way):
108
109$user = ADODB_Session::getUser();
110ADODB_Session::setUser($user);
111
112I've chosen the former as it's makes for a simpler API, and reduces the
113amount of code, but I'd be happy to change it to the latter.
114
115Also, do you think the class should be a singleton class, versus a static
116class?
117
118Let me know if you find this code useful, and will be including it in the
119next release of ADODB.
120
121If so, I will modify the current documentation to detail the new
122functionality.  To that end, what file(s) contain the documentation?  Please
123send them to me if they are not publically available.
124
125Also, if there is *anything* in the code that you like to see changed, let
126me know.
127
128Thanks,
129
130Ross
131
Note: See TracBrowser for help on using the repository browser.