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



Reply via email to