Hello,
I'm experiencing a problem since the BC break.
I have followed the migration plan and almost everything works fine : routes are ok, controllers are found, etc but i have a problem with my Database connection.
It ends in an exception since my object is empty:
#0 /var/www/api_authentification/vendor/aura/sql/src/ExtendedPdo.php(236): PDO->__construct('', NULL, NULL, Array)
My application and database connection used to work perfectly before the new class based config file, so I know that there is something with the new config system
I have this in my Common::define config class :
// set params for Mbrevda\Queryproxy\Db constructor which inherits from PDO
$di->params['Mbrevda\Queryproxy\Db'] = array (
'dsn' => 'pgsql:host=192.168.1.80;dbname=flinteractive;port=5434',
'username' => 'YYY',
'password' => 'XXX',
'options' => array(), // driver options as key-value pairs
'attributes' => array() // attributes as key-value pairs
);
$di->set('db_connection', $di->lazyNew('Mbrevda\Queryproxy\Db'));
// set params for the Thedigital\Model_Template\AbstractModel class
$di->params['Thedigital\Model_Template\AbstractModel'] = [
'db_connection' => $di->lazyGet('db_connection'),
];
My problem :
the $db_connection parameter in my Thedigital\Model_Template\AbstractModel object is an empty Mbrevda\Queryproxy\Db object for some reason I can't find out.
In Thedigital\Model_Template\AbstractModel :
public function __construct(Db $db_connection)
{
var_dump($db_connection);
$this->db_connection = $db_connection;
$this->column_factory = new ColumnFactory();
$this->schema_described = new PgsqlSchema($this->db_connection, $this->column_factory);
}
the var_dump outputs :
object(Mbrevda\Queryproxy\Db)#322 (8) { ["pdo":protected]=> NULL ["attributes":protected]=> array(2) { [3]=> int(2) [20]=> bool(true) } ["dsn":protected]=> NULL ["options":protected]=> array(0) { } ["password":protected]=> NULL ["profile":protected]=> array(0) { } ["profiler":protected]=> NULL ["username":protected]=> NULL }
Did I miss something in my Common.php config file ?
What's the strangest is that the others $di->set or $di->params are correctly filled / set
Advices or hints would be greatly appreciated :D