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

Minor performance improvement in DatabaseAdapterRegistry::autoconfigure() #9361

Merged
merged 1 commit into from
Jan 14, 2020

Conversation

kinglozzer
Copy link
Member

This is called by CoreKernel::getDatabaseConfig() on every request. Currently, this results in a file_exists('vendor/<vendor>/<package>/_configure_database.php') call for every composer dependency & sub-dependency (find vendor/*/* -maxdepth 0 -type d | wc -l - I have almost 300 in one project!).

Micro-optimisations ftw.

Copy link
Contributor

@ScopeyNZ ScopeyNZ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I feel like we should change this in SS5 so any vendor modules have to register some config for this instead!

@robbieaverill robbieaverill merged commit bdc723f into silverstripe:4.5 Jan 14, 2020
@kinglozzer kinglozzer deleted the configure-database-glob branch January 15, 2020 09:17
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.

None yet

3 participants