have a look at my class , i had to do it from scratch as pear db + mdb have too much weight and needed a faster app, being that its going to be on a mysql database only, i send my login variables to a connect function, and those login variables i store in a file outside the web directory
http://electroteque.dyndns.org:1023/benchmark/DB.phps and in connect, the file with the login info is a directory up from htdocs >===== Original Message From Charles Kline <[EMAIL PROTECTED]> ===== >Not sure how to answer your question as I am real new to PHP, but you >may want to look at PEAR if you have not done so. I know there are >libraries that folks have been talking about recently that handle just >these sorts of things. If you don't use them - you may find your >answers by looking at the sources. > >- Charles > >On Sunday, March 16, 2003, at 12:57 PM, [EMAIL PROTECTED] wrote: > >> Hi, >> >> I am currently working on transforming a rather large software package >> to >> oop. I do have a few years of experience with php, but just started to >> use oop. >> One of the first question that arose was how to handle configuration >> vars. >> These should ideally be stored in a file: >> >> <?php >> >> $db_user = "user"; >> $db_password ="secret"; >> >> etc. >> >> ?> >> >> Now, I have to access these vars from a class. >> >> class database { >> >> var $db_user; >> var $db_password; >> >> function connect() >> { >> >> } >> >> } >> >> What is the best way to access these variables? I want to avoid global >> vars. >> I also don't like to set the vars using $object->db_user = $db_user; >> every >> time I use it. >> >> Also, is there any large open-source php - application which could >> serve as >> an example of best practice? >> >> best regards, >> >> Raul >> >> -- >> +++ GMX - Mail, Messaging & more http://www.gmx.net +++ >> Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage! >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php