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