File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ class module
4747
4848function get_db_tools ($ db )
4949{
50+ if (defined ('PHPBB_40 ' ))
51+ {
52+ $ factory = new \phpbb \db \tools \factory ();
53+ return $ factory ->get (get_db_doctrine ());
54+ }
55+
5056 if (defined ('PHPBB_32 ' ))
5157 {
5258 $ factory = new \phpbb \db \tools \factory ();
Original file line number Diff line number Diff line change @@ -539,6 +539,20 @@ function db_close($db = false)
539539 $ db ->sql_close ();
540540}
541541
542+ function get_db_doctrine ()
543+ {
544+ global $ settings ;
545+
546+ return \phpbb \db \doctrine \connection_factory::get_connection_from_params (
547+ $ settings ->get_config ('dbms ' ),
548+ $ settings ->get_config ('dbhost ' ),
549+ $ settings ->get_config ('dbuser ' ),
550+ $ settings ->get_config ('dbpasswd ' ),
551+ $ settings ->get_config ('db_prefix ' ) . $ settings ->get_config ('dbname ' ),
552+ $ settings ->get_config ('dbport ' )
553+ );
554+ }
555+
542556function qi_get_available_dbms ($ dbms )
543557{
544558 if (defined ('PHPBB_32 ' ))
Original file line number Diff line number Diff line change @@ -232,7 +232,12 @@ public function run()
232232
233233 $ db = db_connect ();
234234
235- if (defined ('PHPBB_32 ' ))
235+ if (defined ('PHPBB_40 ' ))
236+ {
237+ $ factory = new \phpbb \db \tools \factory ();
238+ $ db_tools = $ factory ->get (get_db_doctrine ());
239+ }
240+ else if (defined ('PHPBB_32 ' ))
236241 {
237242 $ factory = new \phpbb \db \tools \factory ();
238243 $ db_tools = $ factory ->get ($ db );
You can’t perform that action at this time.
0 commit comments