we converted to 3.3.3 from 2.5.5.
a concurrent connection to a secondary database (set up using
Focus Lab Master Config in both versions) works in 2.5.5 but i get warnings in 3.3.3 with message Warning
Illegal string offset 'hostname'.
it finally completely fails when it tries to run the query and prefixes tables with the primary connection db name instead of the secondary db name.
its loading the primary connection db instead of the secondary connection - all tables names are prefixed with primary connection db name.
we used this syntax in 2.5.5 -
and in the environment specific config for my local is
$env_config['database'] = array ( 'expressionengine' => array ( 'hostname' => 'localhost', 'username' => 'xxxx', 'password' => 'xxxxx', 'database' => 'xxxxx', 'dbdriver' => 'mysqli', 'dbprefix' => 'exp_', 'pconnect' => FALSE ), 'ext_db_components' => array ( 'hostname' => 'localhost', 'username' => 'xxxxx', 'password' => 'xxxxx', 'database' => 'xxxxx', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, 'cache_on' => FALSE, ), );
the error appears on a page that calls a model.
in one of the model methods, it needs to access an external db (housed on same mysql server).
in EE2, loading that external connection using
$this->components_db = $this->EE->load->database('ext_db_components', TRUE);
let us query against it using active record.
the same line of code in EE3 throws Illegal string offset 'hostname' warnings before finally failing with a mysql exception.
FYI - it does appear to be calling the legacy db.php connector (/system/ee/legacy/database/DB.php) rather than the EE3 db connector
is there a way to concurrently connect to an external db using config settings in 3.3.3?
NOTE: I am not asking about switching primary connections based on environment - i need multiple concurrent connections in the same environment.