Exemple #1
0
         } else {
             $arguments_response[] = $argument_array['argument'];
         }
         $i++;
     }
     $error_response['arguments'] = $arguments_response;
     get_labels_JSON_from_query_results("SELECT text FROM label, label2buildfailure\n       WHERE label.id=label2buildfailure.labelid AND\n             label2buildfailure.buildfailureid='{$buildfailureid}'\n       ORDER BY text ASC", $error_response);
     $stderror = $error_array['stderror'];
     $stdoutput = $error_array['stdoutput'];
     if (isset($error_array['sourcefile'])) {
         $projectCvsUrl = $project_array['cvsurl'];
         $file = basename($error_array['sourcefile']);
         $directory = dirname($error_array['sourcefile']);
         $cvsurl = get_diff_url($projectid, $projectCvsUrl, $directory, $file, $revision);
         $error_response['cvsurl'] = $cvsurl;
         $source_dir = get_source_dir($projectid, $projectCvsUrl, $directory);
         if ($source_dir !== NULL) {
             $stderror = linkify_compiler_output($projectCvsUrl, $source_dir, $revision, $stderror);
             $stdoutput = linkify_compiler_output($projectCvsUrl, $source_dir, $revision, $stdoutput);
         }
     }
     if ($stderror) {
         $error_response['stderror'] = $stderror;
     }
     if ($stdoutput) {
         $error_response['stdoutput'] = $stdoutput;
     }
     $error_response['exitcondition'] = $error_array['exitcondition'];
     $errorid++;
     $errors_response[] = $error_response;
 }
Exemple #2
0
 /**
  * Marshal a build failure, this includes the build failure arguments.
  **/
 public static function marshal($data, $project, $revision, $linkifyOutput = false)
 {
     $marshaled = array_merge(array('language' => $data['language'], 'sourcefile' => $data['sourcefile'], 'targetname' => $data['targetname'], 'outputfile' => $data['outputfile'], 'outputtype' => $data['outputtype'], 'workingdirectory' => $data['workingdirectory'], 'exitcondition' => $data['exitcondition']), self::GetBuildFailureArguments($data['id']));
     $marshaled['stderror'] = $data['stderror'];
     $marshaled['stdoutput'] = $data['stdoutput'];
     if (isset($data['sourcefile'])) {
         $file = basename($data['sourcefile']);
         $directory = dirname($data['sourcefile']);
         $marshaled['cvsurl'] = get_diff_url($project['id'], $project['cvsurl'], $directory, $file, $revision);
         $source_dir = get_source_dir($project['id'], $project['cvsurl'], $directory);
         if ($source_dir !== null && $linkifyOutput) {
             $marshaled['stderror'] = linkify_compiler_output($project['cvsurl'], $source_dir, $revision, $data['stderror']);
             $marshaled['stdoutput'] = linkify_compiler_output($project['cvsurl'], $source_dir, $revision, $data['stdoutput']);
         }
     }
     if (isset($data['subprojectid'])) {
         $marshaled['subprojectid'] = $data['subprojectid'];
         $marshaled['subprojectname'] = $data['subprojectname'];
     }
     return $marshaled;
 }