DB.php 1.08 KB
<?php
/**
 * Created by PhpStorm.
 * User: Zip
 * Date: 14/12/9
 * Time: 下午10:32
 */

namespace Hood;

use Hood\Dao\Db\PDOMySQL;
use Hood\Dao\MongoDB\MongoCore;
use Hood\Dao\Db\PostgreSQL;

class DB
{
    /**
     * 原生不带缓存
     * @param $database
     * @return PDOMySQL\PDOConnection
     */
    static function Connection($database)
    {
        return new PDOMySQL\PDOConnection($database);
    }

    /**
     * 快速数据存取(带缓存的DB)
     * @param $database
     * @return PDOMySQL\Quick
     */
    static function Quick($database)
    {
        return new PDOMySQL\Quick($database);
    }

    /**
     * @param $database
     * @return PostgreSQL\PDOConnection
     */
    static function Postgre($database)
    {
        return new PostgreSQL\PDOConnection($database);
    }

    /**
     * @return MongoCore
     */
    static function Mongo()
    {
        return new MongoCore();
    }


    /**
     * @param $database
     * @return PostgreSQL\Former
     */
    static function Former($database)
    {
        return new PostgreSQL\Former($database);
    }
}