-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Config cleanup - OC_Preferences refactoring #12406
Conversation
ref #12260 |
I will tag this a the WIP branch for all of my config related cleanups |
47f0200
to
42460e0
Compare
@@ -61,7 +71,7 @@ public function getAppKeys($appName) { | |||
* @param string $value the value that should be stored | |||
*/ | |||
public function setAppValue($appName, $key, $value) { | |||
\OCP\Config::setAppValue($appName, $key, $value); | |||
\OC::$server->getAppConfig()->setValue($appName, $key, $value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inject AppConfig?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crashes the DI and I need to figure out why.... this is still WIP, but thanks for the comment.
7ad355e
to
343697e
Compare
@@ -63,10 +66,10 @@ public function __construct($view, $userId, $client = false) { | |||
$this->client = $client; | |||
$this->userId = $userId; | |||
|
|||
$appConfig = \OC::$server->getAppConfig(); | |||
$this->config = \OC::$server->getConfig(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be injected instead of being grabbed from global OC::
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but there are currently that many occurences of the create logic of this class, that we also could put this in here. Once this is handled by an dependency container we can easiely add the parameter
38c9166
to
d78a56b
Compare
|
d78a56b
to
71d2d3f
Compare
My last task for this PR will be the removal of all OC_Preferences references in core and apps I find in this github org. |
and fix the unit tests:
|
They work locally :( Let me have a look at the jenkins output. |
6b48c8e
to
ff5aee0
Compare
Many duplicated lines of code in the tests, because of the limits of the not fully mockable unit tests. Will come later. |
* @param string $value | ||
* @param $app | ||
* @param $key | ||
* @param $value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing type annotations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ... they seems to have gone while refactoring. Will add them.
👍 |
Just added type annotations for a deprecated interface. So jenkins can be ignored |
* introduce SystemConfig to avoid DI circle (used by database connection which is itself needed by AllConfig that itself contains the methods to access the config.php which then would need the database connection - did you get it? ;)) * use DI container and use that method in legacy code paths (for easier refactoring later) * create and use getSystemConfig instead of query() in DI container
* keep old static methods - mapped to new ones and deprecated * removed deleteApp, getUsers, getApps because they are unused * make AllConfig unit tests more robust against not cleaned up environments
* this needs to be properly fixed by a proper organisation of the base.php * introduced fixDIInit() in AllConfig that moves the injection of DatabaseConnection to a later point in time * problems mostly because of the autoconfig setup
e2d1fbd
to
16099f3
Compare
New jenkins PR: #12710 |
Damn :( Rebase fuckup -.- |
* files_encryption * files_versions * files_trashbin * tests * status.php * core * server container
16099f3
to
9a7362d
Compare
@DeepDiver1975 @LukasReschke Ready for final review. The rebase just required the deletion of |
The inspection completed: 214 new issues, 34 updated code elements |
Waiting for jenkins in ... #12714 🚀 Test PASSed. 🚀 |
Config cleanup - OC_Preferences refactoring
cc @icewind1991 @DeepDiver1975 @PVince81 @LukasReschke