BacktraceDebugStack.php 585 B

1234567891011121314151617181920
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC\DB;
  8. use Doctrine\DBAL\Logging\DebugStack;
  9. class BacktraceDebugStack extends DebugStack {
  10. public function startQuery($sql, ?array $params = null, ?array $types = null) {
  11. parent::startQuery($sql, $params, $types);
  12. $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
  13. $this->queries[$this->currentQuery]['backtrace'] = $backtrace;
  14. $this->queries[$this->currentQuery]['start'] = $this->start;
  15. }
  16. }