Re: DB_Dataobject: where to put the base classes and myconfig.ini

From: Date: Sun, 19 Jun 2005 23:12:16 +0000
Subject: Re: DB_Dataobject: where to put the base classes and myconfig.ini
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19684@lists.php.net to get a copy of this message
On 6/19/05, Charlie Ward <charliew@caa.org.au> wrote: > I'm using DB_Dataobject and I'm not sure if I am storing the bases > classes and the myconfig file in the right place. At the moment they're > located in a subdirectory of the document root of the webserver: > > Then in my php I do the following: > > $config = parse_ini_file('C:\Program Files\Apache > Group\Apache2\htdocs\DataObjects\myconfig.ini',TRUE); > Putting the classes in your webroot is *ok*, but putting the ini file there is a potential security breach as people could request and read it and thereby get your database password and such. One possibility is to move your ini file (and possible classes) into another location outside of the webroot in a special includes location, similar to your PEAR directory (although I suggest using a different directory). Another solution is to set your DB_DO config in a PHP file using an array. For an example, var_export the array you get back from parse_ini_file, then put that in your PHP script instead of the parse_ini_file line. -- Justin Patrin

« previous php.pear.general (#19684) next »