Feature #13579
closed
Hook Request for t3lib_db
Added by Thomas Maroschik over 13 years ago.
Updated about 6 years ago.
Category:
Database API (Doctrine DBAL)
Description
Hello Xavier,
for the introduction of uuid in TYPO3 I would need some hooks inside t3lib_DB.
Currently I need one after the code before return in
- exec_INSERTquery
- params: $this, $table, $fields_values
- exec_INSERTmultipleRows
- exec_DELETEquery
and one before the code in
- INSERTquery
- params: $this, $table, $field_values
- INSERTmultipleRows
- params: $this, $table, $fields, $rows
- DELETEquery
It would be nice if the hooks would not just call functions, but would execute methods on a hook object. This is needed to keep some state between the hook methods. (see t3lib_tcemain).
Thanks in advance.
Tom
Files
Please find enclosed a proposal that should then be implemented into DBAL too.
Hooks look good and should work perfectly for our neeeds. Maybe these hooks could also be used by DBAL not only implemented too?
Best regards
- Status changed from New to Under Review
- Assignee set to Xavier Perseguers
DBAL part will be tackled with once this patch has been committed as DBAL is using another repository anyway.
Please review change on Gerrit
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Patch has been committed to master
- Status changed from Resolved to On Hold
Actually, waiting for DBAL corresponding patch to be committed to set this patch to "resolved"
- Target version set to 1.3.0 (TYPO3 4.6.0)
Could we reopen that issue?
The interfaces aren't that practical as there is no way to change the given method parameters. You could define some referenced method arguments inside your hook, but then the method signature would not match the one from the interfaces.
Also in init.php there is some duplicate code from t3lib_DB->connectDB upon connecting with t3lib_DB->sql_pconnect to the database.
We could simply replace all lines in init.php with a single call to $TYPO3_DB->connectDB().
By that we would also solve the problem, that the hooks won't get initialized in backend, as t3lib_DB->connectDB is never called.
If reopened, I would push my changes to gerrit.
- Status changed from On Hold to Under Review
Patch in Core has been merged. Review for DBAL pending at http://review.typo3.org/3073
In order to prevent two subsequent calls to preprocessing hooks for TRUNCATE and DELETE, build of actual SQL query within DBAL does not call parent:: anymore. This in turn should even very slightly improve speed at least with bulk changes.
Patch set 2 of change I652cd63ca6dd8da98c8c1b214874a8cad09ae929 has been pushed to the review server.
It is available at http://review.typo3.org/3073
- Status changed from Under Review to Resolved
- Project changed from 329 to TYPO3 Core
- Target version deleted (
1.3.0 (TYPO3 4.6.0))
- Status changed from Resolved to Closed
Also available in: Atom
PDF