-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
Allow options to be provided to Doctrine #40449
base: master
Are you sure you want to change the base?
Conversation
8e6dd8f
to
c5f5f4e
Compare
switch ($param) { | ||
case "sqllogger": | ||
\OC::$server->get(App::class)::registerAppClass($value); | ||
$configuration->setSQLLogger(new $value()); |
Check failure
Code scanning / Psalm
TaintedCallable Error
switch ($param) { | ||
case "sqllogger": | ||
\OC::$server->get(App::class)::registerAppClass($value); | ||
$configuration->setSQLLogger(new $value()); |
Check failure
Code scanning / Psalm
TaintedCallable Error
break; | ||
case "resultcache": | ||
\OC::$server->get(App::class)::registerAppClass($value); | ||
$configuration->setResultCache(new $value()); |
Check failure
Code scanning / Psalm
TaintedCallable Error
break; | ||
case "resultcache": | ||
\OC::$server->get(App::class)::registerAppClass($value); | ||
$configuration->setResultCache(new $value()); |
Check failure
Code scanning / Psalm
TaintedCallable Error
|
||
foreach ($value as $middleware) { | ||
\OC::$server->get(App::class)::registerAppClass($middleware); | ||
array_push($middlewares, new $middleware()); |
Check failure
Code scanning / Psalm
TaintedCallable Error
Signed-off-by: Andrew Summers <[email protected]> Fix issues with return type for `OC_App::findAppInDirectories`
c5f5f4e
to
afa42fd
Compare
QueryBuilder
class #36572 by allowing for custom middlewares and driver wrappersSummary
This allows additional options, configurations, and middlewares to be provided to Doctrine when the DB connection is established.
NOTES
config.php
:dbconnectionparams
anddbconfigurationparams
. I had considered appending these to the existingdbdriveroptions
, but these settings are distinctly different. So, I created new settings.OC\AppFramework\App
:getAppIdForClass()
was incomplete. The function isn't used by anything else, at presentregisterAppClass
was added to allow app classes to be registered prior to actually loading the apps. This is because custom classes must be provided when defining middlewares, custom loggers, etc, but any classes provided by an app aren't available when the DB connection is established. This allows an app's classes to be registered in an out-of-band wayOC\App\AppManager::getAppInfo
was added instead of using the existing class and method. This is because the DB connection must exist in order to load theAppManager
, leading to a race condition.OC\DB\ConnectionFactory
in order to load the options fromconfig.php
, ensure that any custom classes are loaded (using the previously-mentioned methods), and apply the options provided.TODO
Checklist