|
From: Joe Z. <jz...@co...> - 2004-03-17 03:49:45
|
Rene Rask wrote:
>On Tue, 2004-03-16 at 04:36, Joe Zacky wrote:
>
>
>>I have a plan to make bobs support both db3 and db4 in php. I'd like to
>>run it by anyone who cares to comment.
>>
>>1) During the ./configure phase (./configure also runs during rpm
>>install) see whether db3 or db4 is supported. Set a variable in
>>inc/config.php: $sys_conf["dbhandler"] would be either "db3" or "db4".
>>
>>2) add a function get_db_handler() to class_config.php.
>>
>>3) include class_config.php in any files that use dba_open() and use a
>>variable loaded from get_db_handler() for the third parameter (db
>>handler) in dba_open().
>>
>>A php upgrade from db3 to db4 would require re-installing bobs or just
>>changing db3 to db4 in config.php.
>>
>>Any comments are welcome.
>>
>>Joe Zacky
>>
>>
>>
>
>I'm not too happy about this solution. It will come back to bite us. I
>would really prefer a runtime php solution.
>Something like:
> if php >= 4.3.0
> use dba_handlers() to determine available handlers
> else
> try to open a db4 database.
> $db = dba_open("/tmp/randname", "c", "db4")
> if it returns FALSE try a db3 database and check the return value.
> whichever return something other than false gets the job. This would
>also be easier to expand to db5 or the likes in the future.
>
>The reason I'm not happy about the ./configure solution is that some
>users _will_ upgrade their systems at some point, and they will most
>likely not reinstall bobs and we will have tell them what to do every
>time. I see no point in pushing a solution that will lead to problems
>for the users and more support questions for us.
>Having this check run every time a backup is run or a user accesses the
>system (log in and creates a session) is not a problem since the
>additional server load is minimal.
>
>I hope you are on top again. Being sick is no fun :(
>
>Cheers
>Rene
>
>
I'm glad I asked for comments. I completely agree with you. I'll work on
a runtime solution instead. It shouldn't be too difficult.
Thanks for the input.
Joe
|