Skip to content

Conversation

@summersab
Copy link
Contributor

Summary

This allows additional options, configurations, and middlewares to be provided to Doctrine when the DB connection is established.

NOTES

  • Two new optional settings were created in config.php: dbconnectionparams and dbconfigurationparams. I had considered appending these to the existing dbdriveroptions, but these settings are distinctly different. So, I created new settings.
  • In OC\AppFramework\App:
    • The method getAppIdForClass() was incomplete. The function isn't used by anything else, at present
    • The method registerAppClass 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 way
    • A modified version of OC\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 the AppManager, leading to a race condition.
    • Code was added to OC\DB\ConnectionFactory in order to load the options from config.php, ensure that any custom classes are loaded (using the previously-mentioned methods), and apply the options provided.

TODO

  • ...

Checklist

break;
case "schemaassetsfilter":
$configuration->setSchemaAssetsFilter($value);
break;

Check failure

Code scanning / Psalm

TaintedCallable

Detected tainted text
break;
case "schemaassetsfilter":
$configuration->setSchemaAssetsFilter($value);
break;

Check failure

Code scanning / Psalm

TaintedCallable

Detected tainted text
case "autocommit":
$configuration->setAutoCommit($value);
break;
case "middlewares":

Check failure

Code scanning / Psalm

TaintedCallable

Detected tainted text
case "autocommit":
$configuration->setAutoCommit($value);
break;
case "middlewares":

Check failure

Code scanning / Psalm

TaintedCallable

Detected tainted text
}
}

$connection = DriverManager::getConnection(

Check failure

Code scanning / Psalm

TaintedCallable

Detected tainted text
Signed-off-by: Andrew Summers <[email protected]>

Fix issues with return type for `OC_App::findAppInDirectories`
@summersab summersab force-pushed the enh/doctrine/middleware branch from c5f5f4e to afa42fd Compare September 18, 2023 15:14
@solracsf solracsf added this to the Nextcloud 28 milestone Nov 21, 2023
@blizzz blizzz mentioned this pull request Nov 22, 2023
5 tasks
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
This was referenced Mar 12, 2024
@Altahrim Altahrim mentioned this pull request Mar 20, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 6, 2024
@blizzz blizzz modified the milestones: Nextcloud 31, Nextcloud 32 Jan 29, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow additional config parameters for Doctrine

5 participants