示例#1
0
 $authors = array();
 // first is the svnuser
 $posfile = strpos($line, ":");
 if ($posfile !== false) {
     $file = trim(substr($line, 0, $posfile));
     $begauthor = $posfile + 1;
     $endauthor = strpos($line, ",", $begauthor);
     while ($endauthor !== false) {
         $authors[] = trim(substr($line, $begauthor, $endauthor - $begauthor));
         $begauthor = $endauthor + 1;
         $endauthor = strpos($line, ",", $begauthor);
     }
     $authors[] = trim(substr($line, $begauthor));
     // Insert the user
     $CoverageFile = new CoverageFile();
     if ($CoverageFile->GetIdFromName($file, $buildid) === false) {
         $xml .= add_XML_value("warning", "*File not found for: " . $file);
     } else {
         foreach ($authors as $author) {
             $User = new User();
             $CoverageFile2User->UserId = $User->GetIdFromName($author);
             if ($CoverageFile2User->UserId === false) {
                 $xml .= add_XML_value("warning", "*User not found for: " . $author);
             } else {
                 $CoverageFile2User->FullPath = $file;
                 $CoverageFile2User->Insert();
             }
         }
     }
 }
 $pos = $pos2;