1 | <?php |
||
28 | class XoopsDebugStack extends DebugStack |
||
29 | { |
||
30 | /** |
||
31 | * Logs a SQL statement somewhere. |
||
32 | * |
||
33 | * @param string $sql The SQL to be executed. |
||
34 | * @param array $params The SQL parameters. |
||
35 | * @param array $types The SQL parameter types. |
||
36 | * @return void |
||
37 | */ |
||
38 | 101 | public function startQuery($sql, array $params = null, array $types = null) |
|
39 | { |
||
40 | 101 | \Xoops::getInstance()->events()->triggerEvent( |
|
41 | 101 | 'core.database.query.begin', |
|
42 | 101 | [$sql, $params, $types] |
|
43 | ); |
||
44 | 101 | parent::startQuery($sql, $params, $types); |
|
45 | 101 | } |
|
46 | |||
47 | /** |
||
48 | * stopQuery |
||
49 | * |
||
50 | * Perform usual Doctrine DebugStack stopQuery() and trigger event for loggers |
||
51 | * |
||
52 | * Event argument is array: |
||
53 | * - 'sql' => string SQL statement |
||
54 | * - 'params' => array of bound parameters |
||
55 | * - 'types' => array of parameter types |
||
56 | * - 'executionMS' => float of execution time in microseconds |
||
57 | * |
||
58 | * @return void |
||
59 | */ |
||
60 | 97 | public function stopQuery() |
|
68 | } |
||
69 |