I've following class and initPDO fails after adding setAttribute
namespace DBInterface;
class DBInterface {
protected function initPDO() {
$dsn = sprintf('sqlsrv:Server=%s;Database=%s', DB_SQL_SERVERNAME, DB_DB_NAME);
$this->obPDO = new \PDO($dsn, DB_SQL_USERNAME, DB_SQL_PASSWORD);
$this->obPDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
}
Which gives PHP error:
Could not find class file: DBInterface/PDO in root lib directory nor build lib path
Trace: [file] => path\lib\DBInterface\DBInterface.php
[line] => 23
[function] => __autoload
[args] => Array
(
[0] => DBInterface\PDO
)
Do you see something stupid? I can not figure it out oO. Line 23 points at setAttribute method.