<?php

class PDOConfig
{
	var $host;
	var $name;
	var $user;
	var $password;
	function dsn()
	{
		return 'mysql:host='.$this->host.';dbname='.$this->name;
	}
	function PDOConfig($host, $name, $user, $password, $isdefault=true)
	{
		$this->host = $host;
		$this->name = $name;
		$this->user = $user;
		$this->password = $password;
		if ($isdefault)
			$this->makeDefault();
	}
	function makeDefault()
	{
		$c = $this;
		$GLOBALS[pdoconfig] = $this;		
		/*
		array(
			DB_NAME=>$c->name,
			DB_HOST=>$c->host,
			DB_DSN=>$c->dsn(),
			DB_USER=>$c->user,
			DB_PASSWORD=>$c->password, 
		);
		*/
	}
}


?>