building a large-scale application using oop

From: Date: Sun, 16 Mar 2003 17:57:10 +0000
Subject: building a large-scale application using oop
Groups: php.general 
Request: Send a blank email to php-general+get-139855@lists.php.net to get a copy of this message
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!

« previous php.general (#139855) next »