Hello, I'm working with two types of connections on databases with different settings. I want to know how I can get the current connection that the page is running dynamically.
I currently use this:
use Cake\Datasource\ConnectionManager;
$conexao = ConnectionManager::get('default');
$conexao->execute('set local "funcap.usuario" = "build";');
But this returns me information about the fixed connection 'default'
, I wanted something more dynamic like:
$conexão = ConnectioXxx::getCurrent();
I'm using CakePHP in version 3.0