Beispiel #1
0
 public function text($parser, $data)
 {
     $parent = $this->getParent();
     $element = $this->getElement();
     if ($parent == 'BUILD') {
         switch ($element) {
             case 'STARTBUILDTIME':
                 $this->StartTimeStamp = $data;
                 break;
             case 'STARTDATETIME':
                 $this->StartTimeStamp = str_to_time($data, $this->Build->GetStamp());
                 break;
             case 'ELAPSEDMINUTES':
                 $this->EndTimeStamp = $this->StartTimeStamp + $data * 60;
                 break;
             case 'ENDDATETIME':
                 $this->EndTimeStamp = $data;
                 break;
             case 'BUILDCOMMAND':
                 $this->Build->Command = $data;
                 break;
             case 'LOG':
                 $this->Build->Log .= $data;
                 break;
         }
     } else {
         if ($parent == 'ACTION') {
             switch ($element) {
                 case 'LANGUAGE':
                     $this->Error->Language .= $data;
                     break;
                 case 'SOURCEFILE':
                     $this->Error->SourceFile .= $data;
                     break;
                 case 'TARGETNAME':
                     $this->Error->TargetName .= $data;
                     break;
                 case 'OUTPUTFILE':
                     $this->Error->OutputFile .= $data;
                     break;
                 case 'OUTPUTTYPE':
                     $this->Error->OutputType .= $data;
                     break;
             }
         } else {
             if ($parent == 'COMMAND') {
                 switch ($element) {
                     case 'WORKINGDIRECTORY':
                         $this->Error->WorkingDirectory .= $data;
                         break;
                     case 'ARGUMENT':
                         $this->Error->AddArgument($data);
                         break;
                 }
             } else {
                 if ($parent == 'RESULT') {
                     global $CDASH_LARGE_TEXT_LIMIT;
                     $threshold = $CDASH_LARGE_TEXT_LIMIT;
                     $append = true;
                     switch ($element) {
                         case 'STDOUT':
                             if ($threshold > 0) {
                                 if (strlen($this->Error->StdOutput) > $threshold) {
                                     //add_log("avoiding append: long output", "build_handler", LOG_INFO);
                                     $append = false;
                                 }
                             }
                             if ($append) {
                                 $this->Error->StdOutput .= $data;
                             }
                             break;
                         case 'STDERR':
                             if ($threshold > 0) {
                                 if (strlen($this->Error->StdError) > $threshold) {
                                     //add_log("avoiding append: long error", "build_handler", LOG_INFO);
                                     $append = false;
                                 }
                             }
                             if ($append) {
                                 $this->Error->StdError .= $data;
                             }
                             break;
                         case 'EXITCONDITION':
                             $this->Error->ExitCondition .= $data;
                             break;
                     }
                 } else {
                     if ($element == 'BUILDLOGLINE') {
                         $this->Error->LogLine .= $data;
                     } else {
                         if ($element == 'TEXT') {
                             $this->Error->Text .= $data;
                         } else {
                             if ($element == 'SOURCEFILE') {
                                 $this->Error->SourceFile .= $data;
                             } else {
                                 if ($element == 'SOURCELINENUMBER') {
                                     $this->Error->SourceLine .= $data;
                                 } else {
                                     if ($element == 'PRECONTEXT') {
                                         $this->Error->PreContext .= $data;
                                     } else {
                                         if ($element == 'POSTCONTEXT') {
                                             $this->Error->PostContext .= $data;
                                         } else {
                                             if ($element == 'LABEL') {
                                                 $this->Label->SetText($data);
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Beispiel #2
0
 /** text function */
 public function text($parser, $data)
 {
     $parent = $this->getParent();
     $element = $this->getElement();
     if ($parent == 'NOTE') {
         switch ($element) {
             case 'DATETIME':
                 $this->Note->Time = gmdate(FMT_DATETIME, str_to_time($data, $this->Build->GetStamp()));
                 break;
             case 'TEXT':
                 $this->Note->Text .= $data;
                 break;
         }
     }
 }
Beispiel #3
0
 /** Text function */
 public function text($parser, $data)
 {
     $parent = $this->getParent();
     $element = $this->getElement();
     if ($parent == 'TESTING' && $element == 'STARTDATETIME') {
         // Defer to StartTestTime as it has higher precision.
         if (!isset($this->StartTimeStamp)) {
             $this->StartTimeStamp = str_to_time($data, $this->Build->GetStamp());
         }
     } elseif ($parent == 'TESTING' && $element == 'STARTTESTTIME') {
         $this->StartTimeStamp = $data;
     } elseif ($parent == 'TESTING' && $element == 'ENDDATETIME') {
         // Defer to EndTestTime as it has higher precision.
         if (!isset($this->EndTimeStamp)) {
             $this->EndTimeStamp = str_to_time($data, $this->Build->GetStamp());
         }
     } elseif ($parent == 'TESTING' && $element == 'ENDTESTTIME') {
         $this->EndTimeStamp = $data;
     } elseif ($parent == 'TEST') {
         switch ($element) {
             case 'NAME':
                 $this->Test->Name .= $data;
                 break;
             case 'PATH':
                 $this->Test->Path .= $data;
                 break;
             case 'FULLNAME':
                 //$this->Test->Command = $data;
                 break;
             case 'FULLCOMMANDLINE':
                 $this->Test->Command .= $data;
                 break;
         }
     } elseif ($parent == 'NAMEDMEASUREMENT' && $element == 'VALUE') {
         $this->TestMeasurement->Value .= $data;
     } elseif ($parent == 'MEASUREMENT' && $element == 'VALUE') {
         $this->Test->Output .= $data;
     } elseif ($parent == 'LABELS' && $element == 'LABEL') {
         $this->Label->SetText($data);
     }
 }
Beispiel #4
0
 public function text($parser, $data)
 {
     $parent = $this->getParent();
     $element = $this->getElement();
     if ($parent == 'CONFIGURE') {
         switch ($element) {
             case 'STARTDATETIME':
                 $this->StartTimeStamp = str_to_time($data, $this->Build->GetStamp());
                 break;
             case 'STARTCONFIGURETIME':
                 $this->StartTimeStamp = $data;
                 break;
             case 'ENDCONFIGURETIME':
                 $this->EndTimeStamp = $data;
                 break;
             case 'ELAPSEDMINUTES':
                 if ($this->EndTimeStamp === 0) {
                     $this->EndTimeStamp = $this->StartTimeStamp + $data * 60;
                 }
                 break;
             case 'BUILDCOMMAND':
                 $this->Configure->Command .= $data;
                 break;
             case 'LOG':
                 $this->Configure->Log .= $data;
                 break;
             case 'CONFIGURECOMMAND':
                 $this->Configure->Command .= $data;
                 break;
             case 'CONFIGURESTATUS':
                 $this->Configure->Status .= $data;
                 break;
         }
     }
     if ($element == 'LABEL') {
         $this->Label->SetText($data);
     }
 }
function parserss($xml, $rssCate)
{
    global $DMC, $DBPrefix;
    $count_items = preg_match("/<pubDate>(.+?)<\\/pubDate>/is", $xml, $array_date);
    $count_items1 = preg_match("/<description>(.+?)<\\/description>/is", $xml, $array_desc);
    $count_items2 = preg_match("/<title>(.+?)<\\/title>/is", $xml, $array_title);
    $count_items3 = preg_match("/<category>(.+?)<\\/category>/is", $xml, $array_cate);
    if ($count_items != 0) {
        $title = addslashes($array_title[1]);
        if ($rssCate == "") {
            $catetitle = addslashes($array_cate[1]);
            $cateid = getFieldValue($DBPrefix . "categories", "name='{$catetitle}'", "id");
            if ($cateid == "") {
                $cateid = addCategory($catetitle);
            }
            $category = $cateid;
        } else {
            $category = $rssCate;
        }
        if (preg_match("/[0-9]{4}-[0-9]{1,2}-[0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}/i", $array_date[1]) or strstr($array_date[1], "+0000")) {
            $posttime = str_to_time($array_date[1]);
        } else {
            $posttime = strtotime($array_date[1]);
        }
        $content = addslashes($array_desc[1]);
        //echo $array_date[1]."  ===>   ".format_time("L",$posttime)."<br>";
    }
    return array('title' => $title, 'category' => $category, 'posttime' => $posttime, 'content' => $content);
}
Beispiel #6
0
 /** Text function */
 public function text($parser, $data)
 {
     $parent = $this->getParent();
     $element = $this->getElement();
     if ($parent == 'COVERAGE') {
         switch ($element) {
             case 'STARTBUILDTIME':
                 $this->StartTimeStamp .= $data;
                 break;
             case 'STARTDATETIME':
                 $this->StartTimeStamp = str_to_time($data, $this->Build->GetStamp());
                 break;
             case 'ELAPSEDMINUTES':
                 $this->EndTimeStamp = $this->StartTimeStamp + $data * 60;
                 break;
             case 'LOCTESTED':
                 $this->CoverageSummary->LocTested .= $data;
                 break;
             case 'LOCUNTESTED':
                 $this->CoverageSummary->LocUntested .= $data;
                 break;
         }
     } else {
         if ($parent == 'FILE') {
             switch ($element) {
                 case 'LOCTESTED':
                     $this->Coverage->LocTested .= $data;
                     break;
                 case 'LOCUNTESTED':
                     $this->Coverage->LocUntested .= $data;
                     break;
                 case 'BRANCHESTESTED':
                     $this->Coverage->BranchesTested .= $data;
                     break;
                 case 'BRANCHESUNTESTED':
                     $this->Coverage->BranchesUntested .= $data;
                     break;
                 case 'FUNCTIONSTESTED':
                     $this->Coverage->FunctionsTested .= $data;
                     break;
                 case 'FUNCTIONSUNTESTED':
                     $this->Coverage->FunctionsUntested .= $data;
                     break;
             }
         } else {
             if ($element == 'LABEL') {
                 $this->Label->SetText($data);
             }
         }
     }
 }
Beispiel #7
0
 /** Text function */
 public function text($parser, $data)
 {
     $parent = $this->getParent();
     $element = $this->getElement();
     if ($parent == 'TESTING' && $element == 'STARTDATETIME') {
         $this->StartTimeStamp = str_to_time($data, $this->Build->GetStamp());
     } else {
         if ($parent == 'TESTING' && $element == 'STARTTESTTIME') {
             $this->StartTimeStamp = $data;
         } else {
             if ($parent == 'TESTING' && $element == 'ENDDATETIME') {
                 $this->EndTimeStamp = str_to_time($data, $this->Build->GetStamp());
             } else {
                 if ($parent == 'TESTING' && $element == 'ENDTESTTIME') {
                     $this->EndTimeStamp = $data;
                 } else {
                     if ($parent == 'TESTING' && $element == 'ELAPSEDMINUTES') {
                         $this->Build->SaveTotalTestsTime($data);
                     } else {
                         if ($parent == "TEST") {
                             switch ($element) {
                                 case "NAME":
                                     $this->Test->Name .= $data;
                                     break;
                                 case "PATH":
                                     $this->Test->Path .= $data;
                                     break;
                                 case "FULLNAME":
                                     //$this->Test->Command = $data;
                                     break;
                                 case "FULLCOMMANDLINE":
                                     $this->Test->Command .= $data;
                                     break;
                             }
                         } else {
                             if ($parent == "NAMEDMEASUREMENT" && $element == "VALUE") {
                                 $this->TestMeasurement->Value .= $data;
                             } else {
                                 if ($parent == "MEASUREMENT" && $element == "VALUE") {
                                     $this->Test->Output .= $data;
                                 } else {
                                     if ($parent == 'LABELS' && $element == 'LABEL') {
                                         $this->Label->SetText($data);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Beispiel #8
0
 /** Text */
 public function text($parser, $data)
 {
     $element = $this->getElement();
     switch ($element) {
         case 'LINE':
             $this->CurrentLine .= $data;
             break;
         case 'STARTDATETIME':
             $this->StartTimeStamp = str_to_time($data, $this->Build->GetStamp());
             break;
         case 'ENDDATETIME':
             $this->EndTimeStamp = str_to_time($data, $this->Build->GetStamp());
             break;
     }
 }
 /** Function Text */
 public function text($parser, $data)
 {
     $parent = $this->getParent();
     $element = $this->getElement();
     if ($parent == 'DYNAMICANALYSIS') {
         switch ($element) {
             case 'STARTBUILDTIME':
                 $this->StartTimeStamp .= $data;
                 break;
             case 'STARTDATETIME':
                 $this->StartTimeStamp = str_to_time($data, $this->Build->GetStamp());
                 break;
             case 'ELAPSEDMINUTES':
                 $this->EndTimeStamp = $this->StartTimeStamp + $data * 60;
                 break;
         }
     } else {
         if ($parent == 'TEST') {
             switch ($element) {
                 case 'NAME':
                     $this->DynamicAnalysis->Name .= $data;
                     break;
                 case 'PATH':
                     $this->DynamicAnalysis->Path .= $data;
                     break;
                 case 'FULLCOMMANDLINE':
                     $this->DynamicAnalysis->FullCommandLine .= $data;
                     break;
                 case 'LOG':
                     $this->DynamicAnalysis->Log .= $data;
                     break;
             }
         } else {
             if ($parent == 'RESULTS') {
                 if ($element == 'DEFECT') {
                     $this->DynamicAnalysisDefect->Value .= $data;
                 }
             } else {
                 if ($element == 'LABEL') {
                     $this->Label->SetText($data);
                 }
             }
         }
     }
 }
Beispiel #10
0
 /** Text */
 public function text($parser, $data)
 {
     $parent = $this->getParent();
     $element = $this->getElement();
     if ($parent == 'UPDATE') {
         switch ($element) {
             case 'BUILDNAME':
                 $this->Build->Name = $data;
                 if (empty($this->Build->Name)) {
                     $this->Build->Name = "(empty)";
                 }
                 break;
             case 'BUILDSTAMP':
                 $this->Build->SetStamp($data);
                 break;
             case 'SITE':
                 $this->Site->Name = $data;
                 if (empty($this->Site->Name)) {
                     $this->Site->Name = "(empty)";
                 }
                 break;
             case 'STARTTIME':
                 $this->StartTimeStamp = $data;
                 break;
             case 'STARTDATETIME':
                 $this->StartTimeStamp = str_to_time($data, $this->getBuildStamp());
                 break;
             case 'ENDTIME':
                 $this->EndTimeStamp = $data;
                 break;
             case 'ENDDATETIME':
                 $this->EndTimeStamp = str_to_time($data, $this->getBuildStamp());
                 break;
             case 'UPDATECOMMAND':
                 $this->Update->Command .= $data;
                 break;
             case 'UPDATETYPE':
                 $this->Update->Type = $data;
                 break;
             case 'REVISION':
                 $this->Update->Revision = $data;
                 break;
             case 'PRIORREVISION':
                 $this->Update->PriorRevision = $data;
                 break;
             case 'PATH':
                 $this->Update->Path = $data;
                 break;
             case 'UPDATERETURNSTATUS':
                 $this->Update->Status .= $data;
                 break;
         }
     } else {
         if ($parent != 'REVISIONS' && $element == 'FULLNAME') {
             $this->UpdateFile->Filename = $data;
         } else {
             if ($parent != 'REVISIONS' && $element == 'CHECKINDATE') {
                 $this->UpdateFile->CheckinDate = $data;
             } else {
                 if ($parent != 'REVISIONS' && $element == 'AUTHOR') {
                     $this->UpdateFile->Author .= $data;
                 } else {
                     if ($parent != 'REVISIONS' && $element == 'EMAIL') {
                         $this->UpdateFile->Email .= $data;
                     } else {
                         if ($parent != 'REVISIONS' && $element == 'COMMITTER') {
                             $this->UpdateFile->Committer .= $data;
                         } else {
                             if ($parent != 'REVISIONS' && $element == 'COMMITTEREMAIL') {
                                 $this->UpdateFile->CommitterEmail .= $data;
                             } else {
                                 if ($parent != 'REVISIONS' && $element == 'LOG') {
                                     $this->UpdateFile->Log .= $data;
                                 } else {
                                     if ($parent != 'REVISIONS' && $element == 'REVISION') {
                                         if ($data == 'Unknown') {
                                             $data = -1;
                                         }
                                         $this->UpdateFile->Revision = $data;
                                     } else {
                                         if ($parent != 'REVISIONS' && $element == 'PRIORREVISION') {
                                             if ($data == 'Unknown') {
                                                 $data = -1;
                                             }
                                             $this->UpdateFile->PriorRevision = $data;
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }