Jump to content



stefan21

Member Since 08 Jul 2015
OFFLINE Last Active Apr 21 2017 21:48
-----

#1732478 KissER Error Handling & Debugging [contribution]

Posted by stefan21 on 05 August 2015 - 09:05

For 2.3.4 users:

 

This should work in includes/functions/database.php:

 

-snip-

 

  function tep_db_query($query, $link = 'db_link') {
    global $$link;

    if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
      error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
    }
    $start_time = microtime( true );
    $result = mysqli_query($$link, $query) or tep_db_error($query, mysqli_errno($$link), mysqli_error($$link));
    if ( class_exists( 'KissER' ) ) {
      KissER::q( round( ( microtime( true ) - $start_time ), 4 ), $query );
    }
    if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
       $result_error = mysqli_error();
       error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
    }

    return $result;
  }

 

-snip-

 

regards,

stefan