I'm passing an PDO instance to my library using this syntax
$host = 'localhost';
$db = 'ci';
$user = 'root';
$pass = '';
$charset = 'utf8';
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$pdo = new PDO($dsn, $user, $pass);
$params = array('pdo'=>$pdo);
$this->load->library('phpauth/AuthConfig', $params);
But I'm getting this error:
Argument 1 passed to AuthConfig::__construct() must be an instance of PDO, array given
I've searched the manual and other answers I don't see any wrong in my code, how it happens?
By the way, the library I used needs a PDO instance, I have a few doubts here,
1.Is my way of creating a PDO instance the proper way to do it in codeigniter 3?
2.Can I find this PDO instance after using $this->load->database() in my controller, I tried but I can not find it in controller instance
3.Library is using the raw PDO method, my last resort is to use CI3 built in query wrapper to re-style the library method, is this right?