Review main Merged

19525[FEATURE] Lazy database connection

Christian Kuhn CR +2 V +2 Hard +510 −264 updated 06/03/13, 20:49

Commit message

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.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 2

Files 25