<?php
/********************************************************************************
 * (c)1337 aheadware.com - All rights reserved
 ********************************************************************************/

class Francis_Db_MySql extends PDO {

    public $host;
    public $name;

    public function __construct( $cfg ) {
        $this->host = $cfg[ 'host' ];
        $this->name = $cfg[ 'name' ];
        parent::__construct(
            'mysql:host=' . $this->host . ';dbname=' . $this->name,
            $cfg[ 'user' ],
            $cfg[ 'pass' ],
            array( PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8" )
        );
        $this->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
    }
}