From: Boris Z. <bz...@2b...> - 2004-05-11 16:42:37
|
Hi, Am Dienstag, 11. Mai 2004 17:47 schrieb pdu...@so...: > Hi Boris, > > > I include your script to the next release. Perhaps with some minor > > modifications. Maybe we should test if a table exists already instead= of > > the filetest. > > No problem, you can modify it. Maybe it will be a good idea to also > modify pkit_setup_sqlite_dbfile.pl, so that it calls pkit_setup_db.pl, > in order to minimize code, errors and maintenance. > > Here is what happens when you already have the tables in the db: > > $ ~/dev/pagekit=C5pache-PageKit/scripts/pkit_setup_db.pl Pg pagekit pag= euser > xxx DBD::Pg::db do failed: ERROR: relation "pkit_user"already exists a= t > /home/pdupreez/dev/pagekit=C5pache-PageKit/scripts/pkit_setup_db.pl lin= e 56. > ERROR: relation "pkit_user"already exists at > /home/pdupreez/dev/pagekit=C5pache-PageKit/scripts/pkit_setup_db.pl lin= e 56. > > It's cluttered, but clear to me. On the other hand it might be worth > to wive a better output (or even success) to a new-be. One possible Ok, I change the output. > trap will be, if the table is owned by another user. It already > happened to me, as I created the tables by hand. The problem appears > later, when the application can't access the tables, even though they > are there. Yes, but Im not sure if we ever can ensure that the user do it right. The= re=20 are so much databases. And note, that the tables for session and pkit_use= r=20 can differ a lot from the example. I attach the current version of pkit_setup_db.pl not tested so far. > > The ultimate solution will be something like this: > - Tell the user which db drivers he has installed (see > pkit_setup_db.pl for an example) > - Force the user to first setup their Config/Config.xml > A harsh part in the README, or even a curses script might do. > - Add the following variables to Config/Config.xml (maybe in a > separate section, like 'database'): > - DBD (database driver) > - Database name > - Database user (not needed if db is set up for httpd user) > - Database pwd ( ditto ) > - Write a pkit_setup.pl that reads Config/Config.xml in order to: > - Do a sanity check on Config/Config.xml. This will reduce some > first-run-time frustration (and stupid mistakes). > - Check and populate the db. Im unsure if this is the way to go, pagekit is a very powerfull system, t= he=20 users have already more or less experience with databases, apache and per= l=20 for large applications. They just need to know what to do, not something = that=20 do something that satisfy most users. Every PageKit user is already a=20 developer. What I mean is we need a better beginner tutorial with a pagekit-cookbook= ;-). And a better understanding of errors that can occur while trying A::P. > > > Thanks a lot! > > No problem! > > cu > -- > Pieter --=20 Boris |