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

Moving database connection from static variable to DI + related changes. #7490

Closed
wants to merge 75 commits into from

Conversation

diosmosis
Copy link
Member

As title, this pull request's purpose is to move the database connection to DI so it can be easily injected.

Includes many other changes since the connection code is highly coupled.

By the end, should include a proof of concept test that mocks the DB connection to test whether OPTIMIZE TABLES is done for MariaDB InnoDB tables.

@diosmosis diosmosis added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Mar 19, 2015
@mattab mattab modified the milestone: Piwik 2.13.0 Mar 20, 2015
@tsteur
Copy link
Member

tsteur commented Apr 7, 2015

Hard to review, I reckon it's ok :)

@diosmosis
Copy link
Member Author

Forget about this PR for now, can do it later when LocalTracker isn't used.

@mnapoli mnapoli modified the milestones: Short term, Piwik 2.13.0 Apr 10, 2015
@diosmosis diosmosis force-pushed the db_in_di branch 4 times, most recently from 58e9c0d to e201eba Compare June 17, 2015 20:14
@diosmosis diosmosis force-pushed the db_in_di branch 2 times, most recently from b2e4ef9 to 8c7f816 Compare December 28, 2015 22:11
diosmosis added 22 commits December 29, 2015 11:11
…fetch/query/exec methods to it. Will be used as primary low level DB access API by end of PR.
…o connect to the DB w/o having to go through DI or static methods. Separated DB creation/setup from Fixture::performSetUp.
…b adapter. Fix several (but not all) tests.
… test creates a connection & allow SystemTestCase to check if a database connection has been created through DI config. Has some test fixes, but there are still problems w/ this solution.
…tatable options through DI config instead of in TestingEnvironmentManipulator so DB connection is not automatically created during tests. Also removed the Db\Schema class since it is not needed (only the interface is necessary).
…tion and is required to not be created during tests.
…an AdapterInterface through DI. Add all missing methods to AdapterInterface.
…one does not reset the DB config which allows us to reconnect to the DB when needed.
…a resetConfig() call, and quick fix for previous Fixture refactor which is now causing problems.
@mattab
Copy link
Member

mattab commented Jul 25, 2016

Thank you for this proposed pull request.

Because it was last updated more than one month ago, it is our policy to close pull requests opened for a long time without updates. If you would like to continue work on the pull request, please simply ping us to have it re-opened (after you have pushed a new commit).

We hope you understand this and we look forward to seeing an update from you on this pull request or another one!

Thanks.

@mattab mattab closed this Jul 25, 2016
@mattab mattab deleted the db_in_di branch June 21, 2017 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants