Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PdoSnapshotStoreFactory is trying to modificate 'config' object #28

Closed
greatkir opened this issue Nov 8, 2018 · 5 comments
Closed

PdoSnapshotStoreFactory is trying to modificate 'config' object #28

greatkir opened this issue Nov 8, 2018 · 5 comments

Comments

@greatkir
Copy link

greatkir commented Nov 8, 2018

Hello,
I'm trying to integrate this great package with my existing project.
I've encountered a problem with the PdoSnapshotStoreFactory on line 66: $config = &$config[$dimension]; the factory tries to change an existing object provided by the Container.
Is it an expected behavior? In my environment, it throws an Indirect modification of overloaded element of Illuminate\\Config\\Repository has no effect because of this modification attempt. In some other environments, there can be other difficulties because of modification of the external object.

Is it possible to solve this issue and don't change the config object provided by the Container?

@prolic
Copy link
Member

prolic commented Nov 9, 2018

@sandrokeil can you elaborate?

@sandrokeil
Copy link
Member

It was introduced with PR #21 maybe we have to check if it's an object? /cc @basz

@greatkir
Copy link
Author

greatkir commented Nov 12, 2018

Maybe you can create a separate variable in the anonymous function for the config connection value needed because the problem is in changing the $config internal value?

@basz
Copy link
Member

basz commented Nov 13, 2018

I'm not sure this is fixable. As the Illuminate Repository class does not allow for this 'Indirect modification of overloaded element'.

$config = new Repository([]);
$config['test']['test'] = 1;
// Indirect modification of overloaded element of Illuminate\Config\Repository has no effect

Extracting the config array from an ArrayObject in a generic way is also not possible. Illuminate\Config\Repository uses ->all(), Zend/Config/Config uses -> toArray(), and who knows what others do.

Maybe it is time to simply remove this fix. Perhaps throw an exception if the key is still omitted? Would be BC though.

@prolic
Copy link
Member

prolic commented Apr 26, 2019

Since this issue seems to be stalled, I'll close it. Feel free to reopen or create a new issue.

@prolic prolic closed this as completed Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants