Guest User

Untitled

a guest
Jan 21st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. <?php
  2.  
  3. public function _execute(array $params = null)
  4. {
  5. try {
  6. $start = microtime(true);
  7. if ($params !== null) {
  8. $ret = $this->_stmt->execute($params);
  9. } else {
  10. $ret = $this->_stmt->execute();
  11. }
  12.  
  13. $sqlQuery = $this->_stmt->queryString;
  14. if (strpos($sqlQuery, 'db_log') === false) {
  15. Shopware()->Db()->insert(
  16. 'db_log',
  17. [
  18. 'time' => microtime(true) - $start,
  19. 'ident' => $sqlQuery,
  20. 'data' => json_encode($params, JSON_PRETTY_PRINT),
  21. 'trace' => json_encode(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), JSON_PRETTY_PRINT),
  22. 'server' => json_encode($_SERVER, JSON_PRETTY_PRINT),
  23. ]
  24. );
  25. }
  26. return $ret;
  27. } catch (PDOException $e) {
  28. require_once 'Zend/Db/Statement/Exception.php';
  29. throw new Zend_Db_Statement_Exception($e->getMessage(), (int)$e->getCode(), $e);
  30. }
  31. }
Add Comment
Please, Sign In to add comment