|
From: Joe Z. <jz...@co...> - 2004-03-16 03:36:37
|
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 |
|
From: Jochen M. <ml...@om...> - 2004-03-16 08:01:57
|
Hi Joe, sounds great. Am Di, 2004-03-16 um 04.36 schrieb Joe Zacky: > 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. > What are actually the fortunes about it? Cheers Jochen |
|
From: Joe Z. <jz...@co...> - 2004-03-17 03:46:31
|
Jochen Metzger wrote: >Hi Joe, > >sounds great. > >Am Di, 2004-03-16 um 04.36 schrieb Joe Zacky: > > >>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. >> >> >> >What are actually the fortunes about it? > >Cheers Jochen > > I think something got lost in the translation. I don't understand your question. Joe |
|
From: Jochen M. <ml...@om...> - 2004-03-17 13:54:46
|
Am Mi, 2004-03-17 um 04.46 schrieb Joe Zacky: Hi Joe, > Jochen Metzger wrote: > > >Hi Joe, > > > >sounds great. > > > >Am Di, 2004-03-16 um 04.36 schrieb Joe Zacky: > > > > > >>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. > >> > >> > >> > > I think something got lost in the translation. I don't understand your > question. > Mhm, maybe it is better to say>: What are the advantages? Cheers Jochen |
|
From: Joe Z. <jz...@co...> - 2004-03-18 04:07:09
|
>>>>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. >>>> >>>> >>>> >>>> >>>> >What are the advantages? > > >Cheers Jochen > > Rene convinced me to make it check for db3 or db4 support at runtime instead of compile time. So that's what I'm going to do. There's been a problem since the newer version of php came out with db4 support enabled by default instead of db3. Bobs is currently hardcoded to use db3 only. I can find out which version of db3/db4 is enabled in php at bobs runtime so bobs will be able to work with either version of php. Joe |
|
From: Rene R. <re...@gr...> - 2004-03-16 11:35:10
|
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
|
|
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
|