catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.83k stars 1.15k forks source link

Request feature to pass PDO object to constructor #636

Closed kaala closed 6 years ago

kaala commented 6 years ago

At the moment, I work out with subclass the Medoo, but this kind of hack may broken in future release. Please consider add another constructor that can provide raw PDO object, this would great improve the feasible.


use Medoo\Medoo;

class Medoo2 extends Medoo {

    function __construct($type, $pdo) {
        $this->database_type = $type;
        $this->pdo = $pdo;
    }

}
catfan commented 6 years ago

Medoo initialization not only create PDO object, but also initialize more additional option for whole framework. Providing raw PDO object only is not enough.