[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
Showing
- typo3/cli_dispatch.phpsh 1 addition, 1 deletiontypo3/cli_dispatch.phpsh
- typo3/init.php 1 addition, 2 deletionstypo3/init.php
- typo3/install/index.php 1 addition, 1 deletiontypo3/install/index.php
- typo3/sysext/cms/tslib/index_ts.php 24 additions, 9 deletionstypo3/sysext/cms/tslib/index_ts.php
- typo3/sysext/core/Classes/Core/Bootstrap.php 45 additions, 18 deletionstypo3/sysext/core/Classes/Core/Bootstrap.php
- typo3/sysext/core/Classes/Database/DatabaseConnection.php 391 additions, 68 deletionstypo3/sysext/core/Classes/Database/DatabaseConnection.php
- typo3/sysext/core/Classes/Error/AbstractExceptionHandler.php 0 additions, 5 deletionstypo3/sysext/core/Classes/Error/AbstractExceptionHandler.php
- typo3/sysext/core/Classes/Error/ErrorHandler.php 6 additions, 10 deletionstypo3/sysext/core/Classes/Error/ErrorHandler.php
- typo3/sysext/core/Tests/BaseTestCase.php 3 additions, 10 deletionstypo3/sysext/core/Tests/BaseTestCase.php
- typo3/sysext/core/Tests/Integrity/IntegrityTest.php 0 additions, 13 deletionstypo3/sysext/core/Tests/Integrity/IntegrityTest.php
- typo3/sysext/core/Tests/Unit/Cache/Backend/Typo3DatabaseBackendTest.php 0 additions, 7 deletions...ore/Tests/Unit/Cache/Backend/Typo3DatabaseBackendTest.php
- typo3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php 1 addition, 10 deletions...3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php
- typo3/sysext/core/Tests/Unit/Database/PreparedStatementTest.php 10 additions, 18 deletions...sysext/core/Tests/Unit/Database/PreparedStatementTest.php
- typo3/sysext/core/Tests/Unit/Log/Writer/DatabaseTest.php 0 additions, 17 deletionstypo3/sysext/core/Tests/Unit/Log/Writer/DatabaseTest.php
- typo3/sysext/core/Tests/Unit/RegistryTest.php 0 additions, 13 deletionstypo3/sysext/core/Tests/Unit/RegistryTest.php
- typo3/sysext/core/Tests/Unit/Resource/Service/IndexerServiceTest.php 0 additions, 21 deletions...t/core/Tests/Unit/Resource/Service/IndexerServiceTest.php
- typo3/sysext/felogin/Tests/Unit/Controller/FrontendLoginControllerTest.php 0 additions, 7 deletions...gin/Tests/Unit/Controller/FrontendLoginControllerTest.php
- typo3/sysext/frontend/Classes/Controller/ExtDirectEidController.php 0 additions, 1 deletion...xt/frontend/Classes/Controller/ExtDirectEidController.php
- typo3/sysext/frontend/Classes/Controller/ShowImageController.php 0 additions, 2 deletions...ysext/frontend/Classes/Controller/ShowImageController.php
- typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php 11 additions, 2 deletions...ntend/Classes/Controller/TypoScriptFrontendController.php
Please register or sign in to comment