Skip to content
Snippets Groups Projects
Commit c0727f78 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[FEATURE] Lazy database connection

The patch implements "lazy" database connection, a connection
will be established by database connection class on demand.

Bootstrap now just sets credentials of the database connection
class after LocalConfiguration file was read, but does not
initialize the connection on its own anymore.

* Separation of concerns - Bootstrap does not take care of connection
  initialization, the db class will handle it on its own if needed.
* Database connection class got setters for options and credentials,
  it knows the details and can create, sleep and wake up a connection.
* Tests do not need to take care of a special db connection backup
  anymore, mocking / serializing $GLOBALS['TYPO3_DB'] and connection
  is handled by the class automatically.
* eID scripts do not need to call connectDB() anymore: The according
  method in eid handling is obsolete and developers do not need to
  think about it anymore.
* Simplification of bootstrap cross-dependencies.

With the patch only the frontend explicitly calls connectDB(). This
cannot be changed by this patch and needs some more thoughts.

Exception and logging handling is not fully cleaned up and should
be done at a later point. Still, the patch should be fully backward
compatible and dbal should work too, if related patch is applied.

After mysqli switch, main method connectDB() now handles different
port settings correctly and fixes the related issue.

Change-Id: Id977228a525dc2c80085ad21c78a7b7d4044160e
Resolves: #46880
Related: #46825
Releases: 6.1
Reviewed-on: https://review.typo3.org/19525
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
parent f86060fd
Branches
Tags
Showing
with 494 additions and 235 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment