Pheasant\Database\Dsn::__construct PHP Method

__construct() public method

Constructor
public __construct ( $dsn )
    public function __construct($dsn)
    {
        $array = parse_url($dsn);
        if (isset($array['query'])) {
            parse_str($array['query'], $this->params);
        }
        // process params that are named the same as props
        foreach (array('scheme', 'host', 'port', 'user', 'pass') as $p) {
            if (isset($array[$p])) {
                $this->{$p} = $array[$p];
            }
        }
        if (isset($array['path'])) {
            $this->database = basename($array['path']);
        }
    }