Пример #1
0
/**
 * Created by PhpStorm.
 * User: wb-liuyuguang
 * Date: 14-7-31
 * Time: 下午1:30
 */
function get_project_package_list($p_package_id)
{
    $t_acra_prj_table = plugin_table("project");
    $query = "SELECT * FROM {$t_acra_prj_table} WHERE `project_id` = {$p_package_id} LIMIT 0, 1";
    $result = db_query_bound($query);
    $result = db_fetch_array($result);
    if ($result === false) {
        return;
    }
    $packages = $result['packages'];
    return handle_project_package_list($packages);
}
Пример #2
0
 function build_acra_issue_fingerprint($stack_trace, $packages, $pid)
 {
     $decoded = get_stack_map($stack_trace);
     $exception = $decoded->exception;
     $exception = preg_replace('/:?\\s+.*$/i', '', $exception);
     $lines = array();
     $lines[] = $exception;
     require "ProjectAcraExt.php";
     $app_packages = handle_project_package_list($packages);
     foreach ($decoded->stack as $entry) {
         $method = $entry->method;
         foreach ($app_packages as $pack => $len) {
             if (strncmp($method, $pack, $len) === 0) {
                 $lines[] = $entry->method . $entry->suffix;
                 break;
             }
         }
     }
     if (count($lines) === 1) {
         //$lines[] = date("Y-m-d h:i:s");
         foreach ($decoded->stack as $entry) {
             $lines[] = $entry->method;
             //.$entry->suffix;
         }
     }
     $contents = implode("\n", $lines);
     error_log($pid . "stack trace:" . $stack_trace);
     error_log($pid . "fingerprint_text:" . $contents);
     return md5($contents);
 }