framework icon indicating copy to clipboard operation
framework copied to clipboard

`describe` cache shouldn’t create all connections

Open NaderCHASER opened this issue 8 years ago • 4 comments

Resolves #48

NaderCHASER avatar Jan 26 '17 20:01 NaderCHASER

Thanks for providing a patch for this issue. As this tends to be more like a bugfix, can you please submit against the 1.0 branch and use long array syntax. 1.0 was still PHP <5.4.

http://li3.me/development#bugs

mariuswilms avatar Jan 29 '17 15:01 mariuswilms

Just had a deeper look into the issue. Wouldn't disabling autoCreate here, lead to none of the connections having schema caching enabled?

mariuswilms avatar Jan 31 '17 08:01 mariuswilms

You're right. The alternative (previous) approach initiated every connection on every action, though.

I'm not sure how to tackle this yet. The problem lies within the fact that autoConnect defaults to true, leading Connections::get($name) to initiate the connection, regardless of whether or not it's being used for that action. There has to be a way to set autoConnect to false through Connections::get(). I thought it was [ 'config' => [ 'autoConnect' => false ] ] but that didn't appear to work.

NaderCHASER avatar Feb 01 '17 18:02 NaderCHASER

Sorry for not getting back earlier. Yes, there's no obvious bug fix here, that can be applied to just this repo's code. Looks like we need to dig deeper and probably patch Connections.

mariuswilms avatar Apr 27 '17 07:04 mariuswilms