Skip to content

Support class resolver for open storage #1460

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

Merged
merged 3 commits into from
Feb 9, 2024

Conversation

parallels999
Copy link
Contributor

@parallels999 parallels999 commented Sep 11, 2023

For config cache,
Wouldn't it be better to be able to use a resolver by class name instead of a callback method?
So, on storage.open we can set a string class name, where is a resolve method
Or in DEBUGBAR_OPEN_STORAGE we just can set the fqn of the class

@barryvdh
Copy link
Owner

barryvdh commented Feb 9, 2024

Can't this be done in the callback? This doesn't seem like a convention of Laravel?

@parallels999
Copy link
Contributor Author

parallels999 commented Feb 9, 2024

Can't this be done in the callback?

$open = config('debugbar.storage.open');
if (is_callable($open)) {
return call_user_func($open, [$request]);
}

yes, but the problem is that if you set a closure on config, then you can't cache that config, because closure is not serializable ('debugbar.storage.open')

@barryvdh barryvdh merged commit 01c9430 into barryvdh:master Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants