Beispiel #1
0
define('_REPORT_ID', 0);
define('_APP_VERSION_CODE', 1);
define('_APP_VERSION_NAME', 2);
define('_PACKAGE_NAME', 3);
define('_STACK_TRACE', 4);
define('_REPORT_STATE', 5);
define('_CRASH_DATE', 6);
require_once '../updatehelper.php';
$mUpdateHelper = new UpdateHelper();
$mUpdateHelper->begin();
$mUpdateHelper->applySQLUpdateFile();
$mUpdateHelper->exitOnError();
$mUpdateHelper->printStartNextStepMsg('Populate increments table');
// populate table increments
for ($i = 0; $i <= 180; ++$i) {
    $mUpdateHelper->execSQL('INSERT INTO ' . DBHelper::getTblName(TBL_INCREMENTS) . '(' . INC_VALUE . ') VALUES (' . $i . ');');
}
// recreate issue keys with new algorithm
$mUpdateHelper->printStartNextStepMsg('Get reports');
$reports = DBHelper::selectRows(TBL_REPORTS, null, null, 'report_id, app_version_code, app_version_name, package_name, stack_trace, report_state, user_crash_date', null, null, false);
$mUpdateHelper->printStartNextStepMsg('Walk through reports array to create issues');
$issues = array();
try {
    foreach ($reports as $report) {
        $arr = explode("\n", $report[_STACK_TRACE]);
        $cause = $arr[0];
        // create a key to identify the issue from all reports
        $k = DBHelper::getReportIssueKey($report);
        if (!array_key_exists($k, $issues)) {
            $mUpdateHelper->printStepMsg('Create new issue ' . $k);
            $issues[$k] = array('reports' => array(), 'cause' => $cause, 'state' => $report[_REPORT_STATE], 'datetime' => $report[_CRASH_DATE]);
Beispiel #2
0
<?php

define('DIRECT_ACCESS_CHECK', true);
define('BASE_PATH', '../');
require_once 'updatehelper.php';
$mUpdateHelper = new UpdateHelper();
$mUpdateHelper->begin();
$mUpdateHelper->applySQLUpdateFile('db-install.sql');
$mUpdateHelper->exitOnError();
$mUpdateHelper->printStartNextStepMsg('Populate increments table');
// populate table increments
for ($i = 0; $i <= 180; ++$i) {
    $mUpdateHelper->execSQL('INSERT INTO ' . TBL_INCREMENTS . '(' . INC_VALUE . ') VALUES (' . $i . ');');
}
$mUpdateHelper->printEndStepMsg(true, null, true);
$mUpdateHelper->end();