From: Steve W. <sw...@wc...> - 2000-07-11 03:28:38
|
Hola, Something has been bugging me for a while now. Consider: $wiki = RetrievePage($dbi, $pagename); $dba = OpenDataBase($ArchiveDataBase); $archive= RetrievePage($dba, $pagename); This is out of wiki_diff.php3. What's wrong here? PhpWiki 1.03 was based on two DBM files, and only one at a time was opened (except when a copy was saved to the archive, I think). It's not right to make the relational implementations "fake" this behavior because of the DBM heritage; it will be confusing to other programmers and it needlessly gets a second database handle. The relational database implementations actually pass the table name around in $WikiDataBase and $ArchiveDataBase, which is very misleading. I want to add more DBM files to add the new functionality we've been adding, and I will change the way the DBM files are opened... I want to set it up so that we only need one call to OpenDataBase(), and we can do away with: // All requests require the database if ($copy) { // we are editing a copy and want the archive $dbi = OpenDataBase($ArchiveDataBase); include "wiki_editpage.php3"; CloseDataBase($dbi); exit(); } else { // live database $dbi = OpenDataBase($WikiDataBase); } as well. (from index.php3) I don't think this means a lot of hacking... well, outside of the changes to the DBM implementation. Once I have the new DBM code worked out we can go back and weed out the extra OpenDataBase calls. One OpenDataBase() call should serve the rest of the invocation for the most part. Also, there's an interesting comparison of MySQL and Postgesql on PHPbuilder.com right now, if you are interested in how they stack up. And last, I have been experiencing weird behavior with the mSQL version I have set up at http://wcsb.org/~swain/phpwiki/. Most of the time I get an "mSQL database has gone away" error even though it never goes away (the radio station's program schedule runs off that same database and is never down.) I wonder if there isn't some bug in the msql_pconnect() call? At home I use PHP4+mSQL and never see this error. sw ...............................ooo0000ooo................................. Hear FM quality freeform radio through the Internet: http://wcsb.org/ home page: www.wcsb.org/~swain |