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

_configure_database.php no longer works #7590

Closed
2 tasks done
riddler7 opened this issue Nov 13, 2017 · 3 comments
Closed
2 tasks done

_configure_database.php no longer works #7590

riddler7 opened this issue Nov 13, 2017 · 3 comments

Comments

@riddler7
Copy link

riddler7 commented Nov 13, 2017

Would I be wrong in thinking that as $databaseConfig in CoreKernel::getDatabaseConfig no longer uses "global" that _configure_database.php (DatabaseAdapterRegistry) can no longer update the database config?

Trying to use Sqlite for tests but it insists on using a file instead of memory.

PRs

@tractorcow
Copy link
Contributor

Yes it does seem to be broken. For 4.0.1 we can repair this re-using the old global $databaseConfig, but eventually we'll need to replace it with some other API so we can continue our push to drop reliance on globals.

@tractorcow
Copy link
Contributor

It seems easy to fix; Make CoreKernel::getDatabaseConfig() set the config into a global just before calling DatabaseAdapterRegistry::autoconfigure();, and then return that global immediately after.

In 4.1 / 5.0 we should have autoconfigure() take the config as a parameter, and return it in place of a global.

@tractorcow tractorcow self-assigned this Nov 21, 2017
tractorcow pushed a commit to open-sausages/silverstripe-framework that referenced this issue Nov 21, 2017
tractorcow pushed a commit to open-sausages/silverstripe-sqlite3 that referenced this issue Nov 21, 2017
tractorcow pushed a commit to open-sausages/silverstripe-framework that referenced this issue Nov 21, 2017
@tractorcow
Copy link
Contributor

@tractorcow tractorcow removed their assignment Nov 21, 2017
tractorcow pushed a commit to open-sausages/silverstripe-sqlite3 that referenced this issue Nov 21, 2017
tractorcow pushed a commit to open-sausages/silverstripe-sqlite3 that referenced this issue Nov 23, 2017
tractorcow pushed a commit to open-sausages/silverstripe-framework that referenced this issue Nov 28, 2017
flamerohr pushed a commit to open-sausages/silverstripe-framework that referenced this issue Nov 28, 2017
tractorcow pushed a commit to open-sausages/silverstripe-framework that referenced this issue Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants