Class Help Extended

From: Date: Thu, 06 May 2004 05:56:01 +0000
Subject: Class Help Extended
Groups: php.general 
Request: Send a blank email to php-general+get-185497@lists.php.net to get a copy of this message
First off thanks Curt for the attempt at explaining what the purpose was for those, I'm convinced enough to start doing that since that's what the "pros" use. :) However, I know have another concern. As for as class security. Is it wrong to initialize the static variables for my database assignment class ie.. [..Example..] <?php class db_connection { var $user = "dbuser"; var $pass = "dbpass"; var $db = "db"; var $host = "localhost"; var $connection; ....?> [../Example..] or should I still be using the normal seperate file for those values ie... [..Example2..] <?php include_once("dbconn.php"); class db_connection { var $user; var $pass; var $db; var $host; var $connection; ...?> [../Example..] Where in the included file I have the variables listed as $user = username; $pass = password; etc..... The Class files that I am creating are going to be seperate "template" includes if you will where they also are going to be "include_once()" items aswell. Is it over redundant to have both of the files includes? Any help is much appreciated as I'm still learning this exciting language! :) TIA, Wolf

« previous php.general (#185497) next »