1
Hello, I am working with two types of connections in databases with different settings. I want to know how I can get the current connection that the page is running dynamically.
Currently I 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