Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- public function _execute(array $params = null)
- {
- try {
- $start = microtime(true);
- if ($params !== null) {
- $ret = $this->_stmt->execute($params);
- } else {
- $ret = $this->_stmt->execute();
- }
- $sqlQuery = $this->_stmt->queryString;
- if (strpos($sqlQuery, 'db_log') === false) {
- Shopware()->Db()->insert(
- 'db_log',
- [
- 'time' => microtime(true) - $start,
- 'ident' => $sqlQuery,
- 'data' => json_encode($params, JSON_PRETTY_PRINT),
- 'trace' => json_encode(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), JSON_PRETTY_PRINT),
- 'server' => json_encode($_SERVER, JSON_PRETTY_PRINT),
- ]
- );
- }
- return $ret;
- } catch (PDOException $e) {
- require_once 'Zend/Db/Statement/Exception.php';
- throw new Zend_Db_Statement_Exception($e->getMessage(), (int)$e->getCode(), $e);
- }
- }
Add Comment
Please, Sign In to add comment