Context-detection API for Android developed as a university project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

exceptions.php 1.0KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?PHP
  2. require('auth.php');
  3. require('common.php');
  4. ?>
  5. <h1>Exceptions</h1>
  6. <?PHP
  7. $sql = 'SELECT ex_application, ex_ip, ex_imei, ex_version, ex_trace FROM exceptions ORDER BY ex_application, ex_version';
  8. $res = mysql_query($sql);
  9. function fix($x) { return str_replace('.', '/', $x[1]); }
  10. echo '<table border="1">';
  11. while ($row = mysql_fetch_assoc($res)) {
  12. echo '<tr><td><table>';
  13. foreach ($row as $k => $v) { echo '<tr><th>', $k, '</th><td>', $k == 'ex_trace' ? ($points = count(explode("\n", $v))) . ' line(s)' : nl2br(htmlentities($v)), '</td></tr>'; }
  14. echo '</table>';
  15. echo '</td><td><pre>';
  16. parse_str($row['ex_trace'], $data);
  17. echo preg_replace_callback('/__(.*?)__/', 'fix', preg_replace('(at (uk\.co\.md87.*?)(\.[^.]+)\((.*?):([0-9]+)\))', 'at \1\2(<a href="http://github.com/csmith/ContextApi/blob/' . $row['ex_application'] . '/' . $row['ex_version'] . '/code/' . $row['ex_application'] . '/src/__\1__.java#L\4">\3:\4</a>)', htmlentities($data['stacktrace'])));
  18. echo '</pre></td>';
  19. echo '</tr>';
  20. }
  21. echo '</table>';
  22. ?>