Project

General

Profile

Actions

Feature #13579

closed

Hook Request for t3lib_db

Added by Thomas Maroschik over 13 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2011-03-03
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

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
    • params: $this, $table
  • exec_DELETEquery
    • params: $this, $table

and one before the code in

  • INSERTquery
    • params: $this, $table, $field_values
  • INSERTmultipleRows
    • params: $this, $table, $fields, $rows
  • DELETEquery
    • params: $table, $where

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

13579.diff (13.4 KB) 13579.diff Xavier Perseguers, 2011-03-03 15:08

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #27954: Change usage of t3lib_DB->sql_pconnect to t3lib_DB->connectDBClosed2011-07-07

Actions
Actions #1

Updated by Xavier Perseguers over 13 years ago

Please find enclosed a proposal that should then be implemented into DBAL too.

Actions #2

Updated by Thomas Maroschik over 13 years ago

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

Actions #3

Updated by Xavier Perseguers over 13 years ago

  • 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

Actions #4

Updated by Xavier Perseguers over 13 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Patch has been committed to master

Actions #5

Updated by Xavier Perseguers over 13 years ago

  • Status changed from Resolved to On Hold

Actually, waiting for DBAL corresponding patch to be committed to set this patch to "resolved"

Actions #6

Updated by Xavier Perseguers over 13 years ago

  • Target version set to 1.3.0 (TYPO3 4.6.0)
Actions #7

Updated by Thomas Maroschik over 13 years ago

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.

Actions #8

Updated by Xavier Perseguers over 13 years ago

  • 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.

Actions #9

Updated by Mr. Hudson over 13 years ago

Patch set 2 of change I652cd63ca6dd8da98c8c1b214874a8cad09ae929 has been pushed to the review server.
It is available at http://review.typo3.org/3073

Actions #10

Updated by Xavier Perseguers over 13 years ago

  • Status changed from Under Review to Resolved
Actions #11

Updated by Michael Stucki almost 11 years ago

  • Project changed from 329 to TYPO3 Core
  • Target version deleted (1.3.0 (TYPO3 4.6.0))
Actions #12

Updated by Michael Stucki almost 11 years ago

  • Category set to 999
Actions #13

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF