Refactor OC\Server::getDatabaseConnection#40121
Refactor OC\Server::getDatabaseConnection#40121summersab wants to merge 1 commit intonextcloud:masterfrom
OC\Server::getDatabaseConnection#40121Conversation
6866e69 to
57ab25c
Compare
57ab25c to
c613819
Compare
lib/private/Files/Cache/Cache.php
Outdated
| $this->storageCache = new Storage($storage); | ||
| $this->mimetypeLoader = \OC::$server->getMimeTypeLoader(); | ||
| $this->connection = \OC::$server->getDatabaseConnection(); | ||
| $this->connection = \OC::$server->get(IDBConnection::class); |
There was a problem hiding this comment.
| $this->connection = \OC::$server->get(IDBConnection::class); | |
| $this->connection = \OCP\Server::get(IDBConnection::class); |
let's use the public server container API. same applies to most changes below
There was a problem hiding this comment.
I forgot to make this change before pushing, and I'm currently running tests locally. I don't know if you can cancel the tests that are currently running to free up resources, but feel free.
Also, why the change to the public container? In general, when should this be used?
There was a problem hiding this comment.
In general, when should this be used?
In new code: always
In old code: when you touch it anyways
c613819 to
acaf690
Compare
|
I'm getting the following failure: Since this has to do with the |
acaf690 to
2cd272a
Compare
Signed-off-by: Andrew Summers <[email protected]> implement suggested changes from nickvergessen Use the public server container API
2cd272a to
e6f01b3
Compare
|
Too much conflicts, closing until this is done fresh again |
This PR refactors the deprecated method
OC\Server::getDatabaseConnectionand replaces it withOC\Server::get(\OCP\IDBConnection::class)throughout the entire NC codebase (excluding./appsand./3rdparty).Additionally, where necessary, the
\OCP\IDBConnectionclass is imported via theusedirective.