Exemple #1
0
 function compact_backtrace($backtrace, $long_comment = false)
 {
     static $exclude_functions = array('doquery', 'db_query', 'db_get_record_list', 'db_user_by_id', 'db_get_user_by_id');
     $result = array();
     $transaction_id = classSupernova::db_transaction_check(false) ? classSupernova::$transaction_id : classSupernova::$transaction_id++;
     $result[] = "tID {$transaction_id}";
     foreach ($backtrace as $a_trace) {
         if (in_array($a_trace['function'], $exclude_functions)) {
             continue;
         }
         $function = ($a_trace['type'] ? ($a_trace['type'] == '->' ? "({$a_trace['class']})" . get_class($a_trace['object']) : $a_trace['class']) . $a_trace['type'] : '') . $a_trace['function'] . '()';
         $file = str_replace(SN_ROOT_PHYSICAL, '', str_replace('\\', '/', $a_trace['file']));
         // $result[] = "{$function} ({$a_trace['line']})'{$file}'";
         $result[] = "{$function} - '{$file}' Line {$a_trace['line']}";
         if (!$long_comment) {
             break;
         }
     }
     // $result = implode(',', $result);
     return $result;
 }
Exemple #2
0
/**
 * Функция проверяет статус транзакции
 *
 * @param null|true|false $status Должна ли быть запущена транзакция в момент проверки
 *   <p>null - транзакция НЕ должна быть запущена</p>
 *   <p>true - транзакция должна быть запущена - для совместимости с $for_update</p>
 *   <p>false - всё равно - для совместимости с $for_update</p>
 * @return bool Текущий статус транзакции
 */
function sn_db_transaction_check($transaction_should_be_started = null)
{
    return classSupernova::db_transaction_check($transaction_should_be_started);
}