Re: [RfC] Services_Weather
| From: | Tomas V.V.Cox | Date: | Fri, 03 Oct 2003 09:03:40 +0000 |
| Subject: | Re: [RfC] Services_Weather | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-22343@lists.php.net to get a copy of this message | ||
Friday, October 3, 2003, 8:12:15 AM, Arnaud Limbourg wrote:
> Hi,
> The classes look great.
> Stuff i would change
> Why use multiple parameters in (Metar)
> function setMetarDB($dbType, $dbUser, $dbPass, $dbHost, $dbName, $dbOptions)
> {
> $dsn =
> $dbType."://".$dbUser.":".$dbPass."@".$dbHost."/".$dbName;
> $dsninfo = array(
> "phptype" => $dbType,
> "username" => $dbUser,
> "password" => $dbPass,
> "hostspec" => $dbHost,
> "database" => $dbName,
> "mode" => 0644
> );
This is wrong. The PEAR DB dsn contains much more fields than only
these. The way I'd recommend is:
function setMetarDB($dsn)
{
$dsninfo = DB::parseDSN($dsn);
}
It'd support array or string.
--
Tomas V.V.Cox mailto:cox@idecnet.com