예제 #1
0
 /** Remove all coverage information */
 function RemoveAll()
 {
     if (!$this->BuildId) {
         echo "CoverageSummary::RemoveAll(): BuildId not set";
         return false;
     }
     $query = "DELETE FROM coveragesummarydiff WHERE buildid=" . qnum($this->BuildId);
     if (!pdo_query($query)) {
         add_last_sql_error("CoverageSummary RemoveAll");
         return false;
     }
     // coverage file are kept unless they are shared
     $coverage = pdo_query("SELECT fileid FROM coverage WHERE buildid=" . qnum($this->BuildId));
     while ($coverage_array = pdo_fetch_array($coverage)) {
         $fileid = $coverage_array["fileid"];
         // Make sure the file is not shared
         $numfiles = pdo_query("SELECT count(*) FROM coveragefile WHERE id='{$fileid}'");
         $numfiles_array = pdo_fetch_row($numfiles);
         if ($numfiles_array[0] == 1) {
             pdo_query("DELETE FROM coveragefile WHERE id='{$fileid}'");
         }
     }
     $query = "DELETE FROM coverage WHERE buildid=" . qnum($this->BuildId);
     if (!pdo_query($query)) {
         add_last_sql_error("CoverageSummary RemoveAll");
         return false;
     }
     $query = "DELETE FROM coveragefilelog WHERE buildid=" . qnum($this->BuildId);
     if (!pdo_query($query)) {
         add_last_sql_error("CoverageSummary RemoveAll");
         return false;
     }
     $query = "DELETE FROM coveragesummary WHERE buildid=" . qnum($this->BuildId);
     if (!pdo_query($query)) {
         add_last_sql_error("CoverageSummary RemoveAll");
         return false;
     }
     return true;
 }
예제 #2
0
 function mysql_fetch_row($result = NULL)
 {
     return pdo_fetch_row(func_get_args());
 }