Re: DB::connect suggestion
| From: | Christian Rishøj | Date: | Wed, 10 Jan 2001 00:46:38 +0000 |
| Subject: | Re: DB::connect suggestion | ||
| References: | 1 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-926@lists.php.net to get a copy of this message | ||
Hi,
> "Daniel, Adam [EESUS]" wrote:
>
> May I suggest adding logic to the connect method to read the dsn from
> a file in addition to passing the complete dsn string. For example
> you could do something like: $db->connect("dev.dsn") where the file
> "dev.dsn" contains the full dsn as if it were passed as the parameter.
> The two major benefits I see from this are: the convenience of only
> changing one file as apposed to doing a find-and-replace on possibly
> hundreds when moving from development to production;
Why not just (as suggested by John as well) pass the dsn to
$db->connect()
as a variable or possibly a named constant, that you define in _one_
file.
How else would you keep configurations consistent over 'hundreds of
pages'?
> the second being
> the potential to encrypt the dsn file and securing the
> username/password.
Well, this implies that the DSN-file should be decrypted when the script
is
run - meaning that the key for decryption would be stored some place
accessible to the same users that you are trying to hide the DSN-file
from,
leaving us pretty much where we started.
The basic approach to this problem is to secure your webservers shell
access
from unwanted users.
/Christian