From: Steve W. <sw...@wc...> - 2000-09-20 23:51:30
|
Strange your email hasn't come through... > I've slightly modified wiki_mysql.php3 so that it runs with OpenDataBase as > intended. > > Are we using "lib/*" yet? index.php3 still uses wiki_*.php3, so I fixed those > files. No, I only added the directory and tested it on my home box. I read through a lot of CVS docs and couldn't find a good way to rename files, so the log information will be broken up unfortunately. > It looks like the current CVS MAIN branch isn't in good shape. > > E.g. I got a strange bug, where if you edit a file and write > > word1 > word2 > > it would be rendered as "word1word2" (no space!!) > > The cause: Jeff's change in version 1.1.3 of wiki_savepage > He modified > $pagehash["content"] = explode("\n", $content); > to > $pagehash["content"] = preg_split('/[ \t\r]*\n/', chop($content)); > in order to get rid of all unnecessary spaces. > Actually this removed the trailing '\r' our lines used to have in the > pagehash[content] array - that's why some parts may behave strange. > > This (IMHO serious) bug was introduced 2000/07/20 (I don't blame Jeff, these > things just happen). But it got unnoticed until now - or can't you reproduce > the bug? No, I haven't encountered this yet. In the last week or two I did see a link that didn't link, but didn't have time/energy to investigate... I should start using the bug tracking software on SF for that. Now I'll have to go find it again. > Next, "admin/" is broken - it doesn't use the latest DB interface. > > The current form of OpenDataBase is silly. It should be split into a > "ConnectDataBase" and "SelectDataBase". Also, I find the change of 3 > arguments for RetrievePage() questionable. Either use OpenDataBase > throughout, or use 3 argument fucntions throughout, but don't mix the two > cases. This is a Bad Thing to do. hmm. Perhaps I don't understand. Open the database, and interact with the database. But there is a third argument now to specify the table (page or archive). I realized there is an inconsistency that there is one RetrievePage and two functions for inserting pages (InsertPage and SaveCopyToArchive) and that it's a mess and needs cleaning up... since PhpWiki is a fairly small application (that does an awful lot though), it's not too late to munge these things. I think we need to differentiate the page store and the archive, otherwise the archive format has to be the same as the page store format (or schema, if you prefer). It seems to me that in the long run we want either one page store entirely, or two separate stores that differ in schema/format/attributes/whatever. I think I lean towards the latter camp (if we decide that archived pages are stored only as diffs, why store them in the page table?) because the small amount of duplication now will pay off in the long run. > > So what I'm saying is: before Steve releases 1.1.8 we should get our act > together and do some cleanup and testing. Aye! :-) sw ................................ooo0000ooo................................. Hear FM quality freeform radio through the Internet: http://wcsb.org/ home page: www.wcsb.org/~swain |
From: Arno H. <aho...@in...> - 2000-09-21 19:10:41
|
> Strange your email hasn't come through... Neither did yours - but the phpwiki-talk archive on Geocrawler has all messages. My first email surfaced with a 24hours delay. Anyone else seeing these delays with the list? > > E.g. I got a strange bug, where if you edit a file and write > > word1 > > word2 > > it would be rendered as "word1word2" (no space!!) > No, I haven't encountered this yet. Could you verify that? Also, could you verify that my fix in wiki_transform doesn't break things at your end? (try pre-formatted text and see if erroneous empty lines are displayed) > > The current form of OpenDataBase is silly. It should be split into a > > "ConnectDataBase" and "SelectDataBase". > hmm. Perhaps I don't understand. Open the database, and interact with the > database. As it is now, OpenDataBase connects to e.g. mySQL every time it is called. OpenDataBase might be called several times when editing or saving - and everytime it connects to mySQL again. Similar when using dbmlib all dbm files get opened several times. What we really want is to connect/open once, and then just select which database we are using: wiki or archive. > But there is a third argument now to specify the table (page or > archive). I realized there is an inconsistency that there is one > RetrievePage and two functions for inserting pages (InsertPage and > SaveCopyToArchive) and that it's a mess and needs cleaning up... The inconsistence I'm complaining about is: some functions rely on the pagestore opened by OpenDataBase($pagestore) (e.g. the search functions), some are using a 3rd argument (e.g. RetrievePage), and some are splitted into two separate functions alltogether (InsertPage, SaveCopyToArchive). This is bad and will lead to obscure errors. A possible solution: get rid of multiple functions and 3rd arguments, and split OpenDateBase in two functions: a real OpenDB that connects to resp. opens the DB, and a SelectPageStore(). Or use 3 arguments throughout. Going to correct another bug now: search results display lines without safeguarding against HTML - try a fulltext search on wiki and look for the results of TestPage and you see what I mean. Oh, and of course the entire documentation could need an overhaul. Any volunteers? ;o) /Arno |
From: Steve W. <sw...@wc...> - 2000-09-21 20:44:40
|
On Thu, 21 Sep 2000, Arno Hollosi wrote: > > > E.g. I got a strange bug, where if you edit a file and write > > > word1 > > > word2 > > > it would be rendered as "word1word2" (no space!!) > > > No, I haven't encountered this yet. > > Could you verify that? Also, could you verify that my fix in wiki_transform > doesn't break things at your end? (try pre-formatted text and see if > erroneous empty lines are displayed) I will try to test it tonight after 10pm EST... any chance you can create an error on Sourceforge? http://phpwiki.sourceforge.net:80/phpwiki/index.php3?TestPage or here: http://wcsb.org:80/~swain/phpwiki1/index.php3?TestPage This version runs on mSQL and I just ran a cvs update -d on it. > > > The current form of OpenDataBase is silly. It should be split into a > > > "ConnectDataBase" and "SelectDataBase". > > hmm. Perhaps I don't understand. Open the database, and interact with the > > database. > > As it is now, OpenDataBase connects to e.g. mySQL every time it is called. Wow, I must have missed something entirely. There should be only one call to OpenDataBase, and that should be in index.php3. [swain@boojie phpwiki1]$ grep OpenDataBase *php3 index.php3: $dbi = OpenDataBase($WikiPageStore); test_dbmlib.php3: // OpenDataBase() test_dbmlib.php3: $dbi = OpenDataBase($WikiPageStore); test_dbmlib.php3: echo "Return type from OpenDataBase($WikiPageStore): $vartype<br>\n"; wiki_db_filesystem.php3: OpenDataBase($table) wiki_db_filesystem.php3: function OpenDataBase($dbname) { wiki_db_filesystem.php3: $hcdb = OpenDataBase($WikiDB['hitcount']); wiki_db_filesystem.php3: $hcdb = OpenDataBase($WikiDB['hitcount']); wiki_dbmlib.php3: OpenDataBase($table) wiki_dbmlib.php3: function OpenDataBase($dbname) { wiki_diff.php3:// $dba = OpenDataBase($ArchivePageStore); wiki_editpage.php3: // $cdbi = OpenDataBase($WikiPageStore); wiki_msql.php3: OpenDataBase($dbname) wiki_msql.php3: function OpenDataBase($dbinfo) { wiki_mysql.php3: OpenDataBase($dbname) wiki_mysql.php3: function OpenDataBase($dbname) { wiki_mysql.php3: $adbi = OpenDataBase($ArchivePageStore); wiki_pageinfo.php3: // $dbi = OpenDataBase($WikiPageStore); --- done by index.php3 wiki_pageinfo.php3: // $dbi = OpenDataBase($ArchivePageStore); wiki_pgsql.php3: OpenDataBase($table) wiki_pgsql.php3: function OpenDataBase($table) { Sigh. I am going to have to install MySQL to run tests on. The quickest way to debug this is to put an echo statement in OpenDataBase for all libs and make sure it only appears once. > The inconsistence I'm complaining about is: some functions rely on the > pagestore opened by OpenDataBase($pagestore) (e.g. the search functions), > some are using a 3rd argument (e.g. RetrievePage), and some are splitted into > two separate functions alltogether (InsertPage, SaveCopyToArchive). > This is bad and will lead to obscure errors. Yes... I agree, and we'll rectify it. > A possible solution: get rid of multiple functions and 3rd arguments, and > split OpenDateBase in two functions: a real OpenDB that connects to resp. > opens the DB, and a SelectPageStore(). Or use 3 arguments throughout. That would mean: OpenDataBase() SelectPageStore() InsertOrUpdatePage() RetrievePage() > Going to correct another bug now: search results display lines without > safeguarding against HTML - try a fulltext search on wiki and look for the > results of TestPage and you see what I mean. Heh. On wcsb.org search boxes don't render at all at the moment. They work on SF... I'll add search boxes to TestPage. > Oh, and of course the entire documentation could need an overhaul. > Any volunteers? ;o) The lowest of activities! Of course I'll do it :-) sw ...............................ooo0000ooo................................. Hear FM quality freeform radio through the Internet: http://wcsb.org/ home page: www.wcsb.org/~swain |
From: Arno H. <aho...@in...> - 2000-09-21 21:12:06
|
> > > > E.g. I got a strange bug, where if you edit a file and write > > > > it would be rendered as "word1word2" (no space!!) > any chance you can create an error on Sourceforge? > http://phpwiki.sourceforge.net:80/phpwiki/index.php3?TestPage Can't reproduce. SF uses wiki_savepage v1.12 - the bug was introduced in v1.13 (post 1.1.7) > http://wcsb.org:80/~swain/phpwiki1/index.php3?TestPage > This version runs on mSQL and I just ran a cvs update -d on it. Can't reproduce. Seems my fix works ok. > Wow, I must have missed something entirely. There should be only one call > to OpenDataBase, and that should be in index.php3. > [swain@boojie phpwiki1]$ grep OpenDataBase *php3 > Sigh. I am going to have to install MySQL to run tests on. The quickest > way to debug this is to put an echo statement in OpenDataBase for all libs > and make sure it only appears once. I just did this and actually diff,info etc. are ok. When doing a "save page" it gets called twice. Not that bad, but you know ... > Heh. On wcsb.org search boxes don't render at all at the moment. They work > on SF... I'll add search boxes to TestPage. Fixed :o) The new escape is %%Search%% instead of [Search] because of collision with '[]' links - this was changed ages ago - simple edit of the SearchPage. Isn't wiki just nice in that it allows you to edit such fundamental service pages? :o) /Arno |