RE: [PHP] Class Help Extended
| From: | PHP Email List | Date: | Thu, 06 May 2004 07:12:13 +0000 |
| Subject: | RE: [PHP] Class Help Extended | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185500@lists.php.net to get a copy of this message | ||
> More often than not it's a good thing to assign 'default' values to
> class variables like that.
>
> In this case though I've observed that common practice is to get the
> user/pass values from a config file and pass them along as variables
> when creating an instance of the class.
>
> Classes are most beneficial if you can take your class include file
> from one project to the next and just pass along different parameters
> and they work. Including user/pass would force you to edit/change
> those values on every project you use that class in.
>
> HTH
> Richard
True, I do realize that classes are "suppose" to be as portable as possible.
I just wasn't sure from a security stand point that if the dbconfig file is
in with the dbclass file, if it really made a difference since they are both
off of the webtree and being "included" if you will. :)
I much appreciate the feed back. Thanks for your time.
Man PHP ROCKS!! However I only feel that I've only begun to scratch the
surface of it's power. I still haven't done file uploads and directory
listings yet, soon Danielson.....soon.
And the sad part is...sigh, I've just finished a b.e.a.utiful login script
for one of my client's and now I need to rewrite it so that it's a class,
cuz heck I want it for my site too.
$smiley = ":)";
include_once(evil_laugh.php);
echo $laugh $smiley;
//Echo'd: Muuuhahahahahah :)
Thanks again. :}
Wolf