当前位置: 首页>>代码示例>>PHP>>正文


PHP pdo_single_row_query函数代码示例

本文整理汇总了PHP中pdo_single_row_query函数的典型用法代码示例。如果您正苦于以下问题:PHP pdo_single_row_query函数的具体用法?PHP pdo_single_row_query怎么用?PHP pdo_single_row_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pdo_single_row_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testSetupRepositories

 public function testSetupRepositories()
 {
     $insight = new Project();
     $row = pdo_single_row_query("SELECT id FROM project where name='InsightExample'");
     $insight->Id = $row['id'];
     $insight->Fill();
     $insight->AddRepositories(array(':pserver:anoncvs@itk.org:/cvsroot/Insight'), array('anoncvs'), array(''), array(''));
     $insight->CTestTemplateScript = 'client testing works';
     $insight->Save();
     $pub = new Project();
     $row = pdo_single_row_query("SELECT id FROM project where name='PublicDashboard'");
     $pub->Id = $row['id'];
     $pub->Fill();
     $pub->AddRepositories(array('git://cmake.org/cmake.git'), array(''), array(''), array(''));
     $pub->CvsViewerType = 'gitweb';
     $pub->CvsUrl = 'cmake.org/gitweb?p=cmake.git';
     $pub->Save();
     $email = new Project();
     $row = pdo_single_row_query("SELECT id FROM project where name='EmailProjectExample'");
     $email->Id = $row['id'];
     $email->Fill();
     $email->AddRepositories(array('https://www.kitware.com/svn/CDash/trunk'), array(''), array(''), array(''));
     $pub->CvsViewerType = 'websvn';
     $email->CvsUrl = 'https://www.kitware.com/svn/CDash/trunk';
     $email->Save();
 }
开发者ID:kitware,项目名称:cdash,代码行数:26,代码来源:test_setup_repositories.php

示例2: expectedTest

 private function expectedTest($buildname, $projectname)
 {
     // Mark an old build as expected.
     $query = "\n            SELECT b.siteid, b.type, g.id AS groupid FROM build AS b\n            INNER JOIN build2group AS b2g ON (b.id=b2g.buildid)\n            INNER JOIN buildgroup AS g ON (b2g.groupid=g.id)\n            WHERE b.name='{$buildname}'";
     if ($projectname === 'Trilinos') {
         $query .= ' AND b.parentid=-1';
     }
     $build_row = pdo_single_row_query($query);
     $groupid = $build_row['groupid'];
     $buildtype = $build_row['type'];
     $siteid = $build_row['siteid'];
     if (!pdo_query("\n                    INSERT INTO build2grouprule(groupid,buildtype,buildname,siteid,expected,starttime,endtime)\n                    VALUES ('{$groupid}','{$buildtype}','{$buildname}','{$siteid}','1','2013-01-01 00:00:00','1980-01-01 00:00:00')")) {
         $this->fail("Error marking {$buildname} as expected");
         return 1;
     }
     // Verify that our API lists this build even though it hasn't submitted today.
     $this->get($this->url . "/api/v1/index.php?project={$projectname}");
     $content = $this->getBrowser()->getContent();
     $jsonobj = json_decode($content, true);
     $buildgroup = array_pop($jsonobj['buildgroups']);
     $found = false;
     foreach ($buildgroup['builds'] as $build) {
         if ($build['buildname'] == $buildname && $build['expectedandmissing'] == 1) {
             $found = true;
         }
     }
     // Make it unexpected again.
     pdo_query("DELETE FROM build2grouprule WHERE buildname='{$buildname}'");
     if (!$found) {
         $this->fail("Expected missing build '{$buildname}' not included");
         return 1;
     }
     $this->pass('Passed');
     return 0;
 }
开发者ID:kitware,项目名称:cdash,代码行数:35,代码来源:test_expectedandmissing.php

示例3: testTruncateOutput

 public function testTruncateOutput()
 {
     // Set a limit so long output will be truncated.
     $this->addLineToConfig($this->ConfigLine);
     // Submit our testing data.
     $rep = dirname(__FILE__) . "/data/TruncateOutput";
     if (!$this->submission('InsightExample', "{$rep}/Build.xml")) {
         $this->fail("failed to submit Build.xml");
         $this->cleanup();
         return 1;
     }
     // Query for the ID of the build that we just created.
     $buildid_results = pdo_single_row_query("SELECT id FROM build WHERE name='TruncateOutput'");
     $this->BuildId = $buildid_results['id'];
     // Verify that the output was properly truncated.
     $this->get($this->url . "/api/v1/viewBuildError.php?buildid=" . $this->BuildId);
     $content = $this->getBrowser()->getContent();
     $jsonobj = json_decode($content, true);
     foreach ($jsonobj['errors'] as $error) {
         if ($error['stdoutput'] != $this->Expected) {
             $this->fail("Expected {$this->Expected}, found " . $error['stdoutput']);
             $this->cleanup();
             return 1;
         }
         if ($error['stderror'] != $this->Expected) {
             $this->fail("Expected {$this->Expected}, found " . $error['stderror']);
             $this->cleanup();
             return 1;
         }
     }
     $this->cleanup();
     $this->pass("Passed");
     return 0;
 }
开发者ID:kitware,项目名称:cdash,代码行数:34,代码来源:test_truncateoutput.php

示例4: echo_currently_processing_submissions

function echo_currently_processing_submissions()
{
    include "cdash/config.php";
    if ($CDASH_DB_TYPE == "pgsql") {
        $sql_query = "SELECT now() AT TIME ZONE 'UTC'";
    } else {
        $sql_query = "SELECT UTC_TIMESTAMP()";
    }
    $current_time = pdo_single_row_query($sql_query);
    $sql_query = "SELECT project.name, submission.*, ";
    if ($CDASH_DB_TYPE == "pgsql") {
        $sql_query .= "round((extract(EPOCH FROM now() - created)/3600)::numeric, 2) AS hours_ago ";
    } else {
        $sql_query .= "ROUND(TIMESTAMPDIFF(SECOND, created, UTC_TIMESTAMP)/3600, 2) AS hours_ago ";
    }
    $sql_query .= "FROM " . qid("project") . ", " . qid("submission") . " " . "WHERE project.id = submission.projectid AND status = 1";
    $rows = pdo_all_rows_query($sql_query);
    $sep = ', ';
    echo "<h3>Currently Processing Submissions as of " . $current_time[0] . " UTC</h3>";
    echo '<pre>';
    if (count($rows) > 0) {
        echo 'project name, backlog in hours' . "\n";
        echo '    submission.id, filename, projectid, status, attempts, filesize, filemd5sum, lastupdated, created, started, finished' . "\n";
        echo "\n";
        foreach ($rows as $row) {
            echo $row['name'] . $sep . $row['hours_ago'] . ' hours behind' . "\n";
            echo "    " . $row['id'] . $sep . $row['filename'] . $sep . $row['projectid'] . $sep . $row['status'] . $sep . $row['attempts'] . $sep . $row['filesize'] . $sep . $row['filemd5sum'] . $sep . $row['lastupdated'] . $sep . $row['created'] . $sep . $row['started'] . $sep . $row['finished'] . "\n";
            echo "\n";
        }
    } else {
        echo 'Nothing is currently processing...' . "\n";
    }
    echo '</pre>';
    echo '<br/>';
}
开发者ID:rpshaw,项目名称:CDash,代码行数:35,代码来源:monitor.php

示例5: MD5Exists

 function MD5Exists()
 {
     $md5 = pdo_real_escape_string($this->md5);
     $row = pdo_single_row_query("SELECT buildid FROM buildfile WHERE md5='" . $md5 . "'");
     if (empty($row)) {
         return false;
     }
     return $row[0];
 }
开发者ID:rpshaw,项目名称:CDash,代码行数:9,代码来源:buildfile.php

示例6: pdo_get_field_value

function pdo_get_field_value($qry, $fieldname, $default)
{
    $row = pdo_single_row_query($qry);
    if (!empty($row)) {
        $f = $row["{$fieldname}"];
    } else {
        $f = $default;
    }
    return $f;
}
开发者ID:rpshaw,项目名称:CDash,代码行数:10,代码来源:pdo.php

示例7: testBuildGetDate

 public function testBuildGetDate()
 {
     $retval = 0;
     $build = new Build();
     $build->Id = 1;
     $build->ProjectId = 1;
     $build->Filled = true;
     $row = pdo_single_row_query('SELECT nightlytime FROM project WHERE id=1');
     $original_nightlytime = $row['nightlytime'];
     // Test the case where the project's start time is in the evening.
     pdo_query("UPDATE project SET nightlytime = '20:00:00' WHERE id=1");
     $build->StartTime = date('Y-m-d H:i:s', strtotime('2009-02-23 19:59:59'));
     $expected_date = '2009-02-23';
     $date = $build->GetDate();
     if ($date !== $expected_date) {
         $this->fail("Evening case: expected {$expected_date}, found {$date}");
         $retval = 1;
     }
     $build->StartTime = date('Y-m-d H:i:s', strtotime('2009-02-23 20:00:00'));
     $expected_date = '2009-02-24';
     $build->NightlyStartTime = false;
     $date = $build->GetDate();
     if ($date !== $expected_date) {
         $this->fail("Evening case: expected {$expected_date}, found {$date}");
         $retval = 1;
     }
     // Test the case where the project's start time is in the morning.
     pdo_query("UPDATE project SET nightlytime = '09:00:00' WHERE id=1");
     $build->StartTime = date('Y-m-d H:i:s', strtotime('2009-02-23 08:59:59'));
     $expected_date = '2009-02-22';
     $build->NightlyStartTime = false;
     $date = $build->GetDate();
     if ($date !== $expected_date) {
         $this->fail("Morning case: expected {$expected_date}, found {$date}");
         $retval = 1;
     }
     $build->StartTime = date('Y-m-d H:i:s', strtotime('2009-02-23 09:00:00'));
     $expected_date = '2009-02-23';
     $build->NightlyStartTime = false;
     $date = $build->GetDate();
     if ($date !== $expected_date) {
         $this->fail("Morning case: expected {$expected_date}, found {$date}");
         $retval = 1;
     }
     pdo_query("UPDATE project SET nightlytime = '{$original_nightlytime}' WHERE id=1");
     if ($retval === 0) {
         $this->pass('Tests passed');
     }
     return $retval;
 }
开发者ID:kitware,项目名称:cdash,代码行数:50,代码来源:test_buildgetdate.php

示例8: Exists

 /** Return whether or not a CoverageSummaryDiff exists for this build. */
 public function Exists()
 {
     if (!$this->BuildId) {
         return false;
     }
     $exists_result = pdo_single_row_query('SELECT COUNT(1) AS numrows FROM coveragesummarydiff
             WHERE buildid=' . qnum($this->BuildId));
     if ($exists_result && array_key_exists('numrows', $exists_result)) {
         $numrows = $exists_result['numrows'];
         if ($numrows > 0) {
             return true;
         }
     }
     return false;
 }
开发者ID:kitware,项目名称:cdash,代码行数:16,代码来源:coveragesummarydiff.php

示例9: get_dynamic_builds

function get_dynamic_builds($projectid, $end_UTCDate)
{
    $builds = array();
    // Get the build rules for each dynamic group belonging to this project.
    $rules = pdo_query("\n    SELECT b2gr.buildname, b2gr.siteid, b2gr.parentgroupid, bg.id, bg.name,\n           bg.type, gp.position\n    FROM build2grouprule AS b2gr\n    LEFT JOIN buildgroup AS bg ON (bg.id = b2gr.groupid)\n    LEFT JOIN buildgroupposition AS gp ON (gp.buildgroupid=bg.id)\n    WHERE bg.projectid='{$projectid}' AND bg.endtime='1980-01-01 00:00:00' AND\n          bg.type != 'Daily'");
    if (!$rules) {
        echo pdo_error();
        return;
    }
    while ($rule = pdo_fetch_array($rules)) {
        $buildgroup_name = $rule['name'];
        $buildgroup_id = $rule['id'];
        $buildgroup_position = $rule['position'];
        if ($rule['type'] == 'Latest') {
            // optional fields: parentgroupid, site, and build name match.
            // Use these to construct a WHERE clause for our query.
            $where = '';
            $whereClauses = array();
            if (!empty($rule['parentgroupid'])) {
                $whereClauses[] = "b2g.groupid='" . $rule['parentgroupid'] . "'";
            }
            if (!empty($rule['siteid'])) {
                $whereClauses[] = "s.id='" . $rule['siteid'] . "'";
            }
            if (!empty($rule['buildname'])) {
                $whereClauses[] = "b.name LIKE '" . $rule['buildname'] . "'";
            }
            if (!empty($whereClauses)) {
                $where = 'WHERE ' . implode($whereClauses, ' AND ');
                $where .= " AND b.starttime<'{$end_UTCDate}'";
            }
            // We only want the most recent build.
            $order = 'ORDER BY b.submittime DESC LIMIT 1';
            $sql = get_index_query();
            $sql .= "{$where} {$order}";
            $build = pdo_single_row_query($sql);
            if (empty($build)) {
                continue;
            }
            $build['groupname'] = $buildgroup_name;
            $build['groupid'] = $buildgroup_id;
            $build['position'] = $buildgroup_position;
            $builds[] = $build;
        }
    }
    return $builds;
}
开发者ID:kitware,项目名称:cdash,代码行数:47,代码来源:index_functions.php

示例10: get_dynamic_builds

function get_dynamic_builds($projectid)
{
    $builds = array();
    // Get the build rules for each dynamic group belonging to this project.
    $rules = pdo_query("\n    SELECT b2gr.buildname, b2gr.siteid, b2gr.parentgroupid, bg.id, bg.name,\n           bg.type, gp.position\n    FROM build2grouprule AS b2gr\n    LEFT JOIN buildgroup AS bg ON (bg.id = b2gr.groupid)\n    LEFT JOIN buildgroupposition AS gp ON (gp.buildgroupid=bg.id)\n    WHERE bg.projectid='{$projectid}' AND bg.endtime='1980-01-01 00:00:00' AND\n          bg.type != 'Daily'");
    if (!$rules) {
        echo pdo_error();
        return;
    }
    while ($rule = pdo_fetch_array($rules)) {
        $buildgroup_name = $rule['name'];
        $buildgroup_id = $rule['id'];
        $buildgroup_position = $rule['position'];
        if ($rule['type'] == 'Latest') {
            // optional fields: parentgroupid, site, and build name match.
            // Use these to construct a WHERE clause for our query.
            $where = "";
            $whereClauses = array();
            if (!empty($rule['parentgroupid'])) {
                $whereClauses[] = "b2g.groupid='" . $rule['parentgroupid'] . "'";
            }
            if (!empty($rule['siteid'])) {
                $whereClauses[] = "s.id='" . $rule['siteid'] . "'";
            }
            if (!empty($rule['buildname'])) {
                $whereClauses[] = "b.name LIKE '" . $rule['buildname'] . "'";
            }
            if (!empty($whereClauses)) {
                $where = "WHERE " . implode($whereClauses, " AND ");
            }
            // We only want the most recent build.
            $order = "ORDER BY b.submittime DESC LIMIT 1";
            // Copied from index.php.
            $sql = "SELECT b.id,b.siteid,b.parentid,\n              bu.status AS updatestatus,\n              i.osname AS osname,\n              bu.starttime AS updatestarttime,\n              bu.endtime AS updateendtime,\n              bu.nfiles AS countupdatefiles,\n              bu.warnings AS countupdatewarnings,\n              c.status AS configurestatus,\n              c.starttime AS configurestarttime,\n              c.endtime AS configureendtime,\n              be_diff.difference_positive AS countbuilderrordiffp,\n              be_diff.difference_negative AS countbuilderrordiffn,\n              bw_diff.difference_positive AS countbuildwarningdiffp,\n              bw_diff.difference_negative AS countbuildwarningdiffn,\n              ce_diff.difference AS countconfigurewarningdiff,\n              btt.time AS testsduration,\n              tnotrun_diff.difference_positive AS counttestsnotrundiffp,\n              tnotrun_diff.difference_negative AS counttestsnotrundiffn,\n              tfailed_diff.difference_positive AS counttestsfaileddiffp,\n              tfailed_diff.difference_negative AS counttestsfaileddiffn,\n              tpassed_diff.difference_positive AS counttestspasseddiffp,\n              tpassed_diff.difference_negative AS counttestspasseddiffn,\n              tstatusfailed_diff.difference_positive AS countteststimestatusfaileddiffp,\n              tstatusfailed_diff.difference_negative AS countteststimestatusfaileddiffn,\n              (SELECT count(buildid) FROM build2note WHERE buildid=b.id)  AS countnotes,\n              (SELECT count(buildid) FROM buildnote WHERE buildid=b.id) AS countbuildnotes,\n              s.name AS sitename,\n              s.outoforder AS siteoutoforder,\n              b.stamp,b.name,b.type,b.generator,b.starttime,b.endtime,b.submittime,\n              b.configureerrors AS countconfigureerrors,\n              b.configurewarnings AS countconfigurewarnings,\n              b.builderrors AS countbuilderrors,\n              b.buildwarnings AS countbuildwarnings,\n              b.testnotrun AS counttestsnotrun,\n              b.testfailed AS counttestsfailed,\n              b.testpassed AS counttestspassed,\n              b.testtimestatusfailed AS countteststimestatusfailed,\n              sp.id AS subprojectid,\n              sp.groupid AS subprojectgroup,\n              (SELECT count(buildid) FROM errorlog WHERE buildid=b.id) AS nerrorlog,\n              (SELECT count(buildid) FROM build2uploadfile WHERE buildid=b.id) AS builduploadfiles\n              FROM build AS b\n              LEFT JOIN build2group AS b2g ON (b2g.buildid=b.id)\n              LEFT JOIN buildgroup AS g ON (g.id=b2g.groupid)\n              LEFT JOIN site AS s ON (s.id=b.siteid)\n              LEFT JOIN build2update AS b2u ON (b2u.buildid=b.id)\n              LEFT JOIN buildupdate AS bu ON (b2u.updateid=bu.id)\n              LEFT JOIN configure AS c ON (c.buildid=b.id)\n              LEFT JOIN buildinformation AS i ON (i.buildid=b.id)\n              LEFT JOIN builderrordiff AS be_diff ON (be_diff.buildid=b.id AND be_diff.type=0)\n              LEFT JOIN builderrordiff AS bw_diff ON (bw_diff.buildid=b.id AND bw_diff.type=1)\n              LEFT JOIN configureerrordiff AS ce_diff ON (ce_diff.buildid=b.id AND ce_diff.type=1)\n              LEFT JOIN buildtesttime AS btt ON (btt.buildid=b.id)\n              LEFT JOIN testdiff AS tnotrun_diff ON (tnotrun_diff.buildid=b.id AND tnotrun_diff.type=0)\n              LEFT JOIN testdiff AS tfailed_diff ON (tfailed_diff.buildid=b.id AND tfailed_diff.type=1)\n              LEFT JOIN testdiff AS tpassed_diff ON (tpassed_diff.buildid=b.id AND tpassed_diff.type=2)\n              LEFT JOIN testdiff AS tstatusfailed_diff ON (tstatusfailed_diff.buildid=b.id AND tstatusfailed_diff.type=3)\n              LEFT JOIN subproject2build AS sp2b ON (sp2b.buildid = b.id)\n              LEFT JOIN subproject as sp ON (sp2b.subprojectid = sp.id)\n              LEFT JOIN label2build AS l2b ON (l2b.buildid = b.id)\n              LEFT JOIN label AS l ON (l.id = l2b.labelid) {$where} {$order}";
            $build = pdo_single_row_query($sql);
            if (empty($build)) {
                continue;
            }
            $build['groupname'] = $buildgroup_name;
            $build['groupid'] = $buildgroup_id;
            $build['position'] = $buildgroup_position;
            $builds[] = $build;
        }
    }
    return $builds;
}
开发者ID:rpshaw,项目名称:CDash,代码行数:46,代码来源:index_functions.php

示例11: testNotesAPI

 public function testNotesAPI()
 {
     echo "1. testNotesAPI\n";
     // Find the smallest buildid that has more than one note.
     // This was 13 at the time this test was written, but things
     // like this have a habit of changing.
     $buildid_result = pdo_single_row_query('SELECT buildid, COUNT(1) FROM build2note
    GROUP BY buildid HAVING COUNT(1) > 1 ORDER BY buildid LIMIT 1');
     if (empty($buildid_result)) {
         $this->fail('No build found with multiple notes');
         return 1;
     }
     $buildid = $buildid_result['buildid'];
     // Use the API to get the notes for this build.
     $this->get($this->url . "/api/v1/viewNotes.php?buildid={$buildid}");
     $response = json_decode($this->getBrowser()->getContentAsText(), true);
     // Verify some details about this builds notes.
     $numNotes = count($response['notes']);
     if ($numNotes != 2) {
         $this->fail("Expected two notes, found {$numNotes}");
         return 1;
     }
     $driverFound = false;
     $cronFound = false;
     foreach ($response['notes'] as $note) {
         if (strpos($note['name'], 'TrilinosDriverDashboard.cmake') !== false) {
             $driverFound = true;
         }
         if (strpos($note['name'], 'cron_driver.bat') !== false) {
             $cronFound = true;
         }
     }
     if ($driverFound === false) {
         $this->fail('Expected to find a note named TrilinosDriverDashboard.cmake');
         return 1;
     }
     if ($cronFound === false) {
         $this->fail('Expected to find a note named cron_driver.bat');
         return 1;
     }
     $this->pass('Passed');
     return 0;
 }
开发者ID:kitware,项目名称:cdash,代码行数:43,代码来源:test_notesapi.php

示例12: testExternalLinksFromTests

 public function testExternalLinksFromTests()
 {
     // Submit our testing data.
     $file_to_submit = dirname(__FILE__) . '/data/ExternalLinksFromTests/Test.xml';
     if (!$this->submission('InsightExample', $file_to_submit)) {
         $this->fail("Failed to submit {$file_to_submit}");
         return 1;
     }
     // Get the IDs for the build and test that we just created.
     $result = pdo_single_row_query("SELECT id FROM build WHERE name = 'test_output_link'");
     $buildid = $result['id'];
     $result = pdo_single_row_query("SELECT testid FROM build2test WHERE buildid={$buildid}");
     $testid = $result['testid'];
     // Use the API to verify that our external link was parsed properly.
     $this->get($this->url . "/api/v1/testDetails.php?test={$testid}&build={$buildid}");
     $content = $this->getBrowser()->getContent();
     $jsonobj = json_decode($content, true);
     $measurement = array_pop($jsonobj['test']['measurements']);
     $success = true;
     $error_msg = '';
     if ($measurement['name'] !== 'Interesting website') {
         $error_msg = "Expected name to be 'Interesting website', instead found " . $measurement['name'];
         $success = false;
     }
     if ($measurement['type'] !== 'text/link') {
         $error_msg = "Expected type to be 'text/link', instead found " . $measurement['type'];
         $success = false;
     }
     if ($measurement['value'] !== 'http://www.google.com') {
         $error_msg = "Expected value to be 'http://www.google.com', instead found " . $measurement['value'];
         $success = false;
     }
     // Delete the build that we created during this test.
     remove_build($buildid);
     if (!$success) {
         $this->fail($error_msg);
         return 1;
     }
     $this->pass('Tests passed');
     return 0;
 }
开发者ID:kitware,项目名称:cdash,代码行数:41,代码来源:test_externallinksfromtests.php

示例13: onlyColumn

 public function onlyColumn($method)
 {
     // Submit our testing file.
     $rep = dirname(__FILE__) . '/data/HideColumns';
     if (!$this->submission('InsightExample', "{$rep}/{$method}.xml")) {
         return false;
     }
     // Use our API to verify which columns will be displayed.
     $content = $this->connect($this->url . '/api/v1/index.php?project=InsightExample&date=2015-10-06');
     $jsonobj = json_decode($content, true);
     $buildgroup = array_pop($jsonobj['buildgroups']);
     $retval = false;
     switch ($method) {
         case 'Update':
             if ($buildgroup['hasupdatedata'] == true && $buildgroup['hasconfiguredata'] == false && $buildgroup['hascompilationdata'] == false && $buildgroup['hastestdata'] == false) {
                 $retval = true;
             }
             break;
         case 'Configure':
             if ($buildgroup['hasupdatedata'] == false && $buildgroup['hasconfiguredata'] == true && $buildgroup['hascompilationdata'] == false && $buildgroup['hastestdata'] == false) {
                 $retval = true;
             }
             break;
         case 'Build':
             if ($buildgroup['hasupdatedata'] == false && $buildgroup['hasconfiguredata'] == false && $buildgroup['hascompilationdata'] == true && $buildgroup['hastestdata'] == false) {
                 $retval = true;
             }
             break;
         case 'Test':
             if ($buildgroup['hasupdatedata'] == false && $buildgroup['hasconfiguredata'] == false && $buildgroup['hascompilationdata'] == false && $buildgroup['hastestdata'] == true) {
                 $retval = true;
             }
             break;
     }
     // Remove the build that we just created.
     $buildid_results = pdo_single_row_query("SELECT id FROM build WHERE name='HideColumns'");
     $buildid = $buildid_results['id'];
     remove_build($buildid);
     return $retval;
 }
开发者ID:kitware,项目名称:cdash,代码行数:40,代码来源:test_hidecolumns.php

示例14: testParallelSubmissions

 public function testParallelSubmissions()
 {
     // Delete the existing Trilinos build.
     $row = pdo_single_row_query("SELECT id FROM build\n                WHERE parentid=-1 AND\n                projectid=(SELECT id FROM project WHERE name='Trilinos') AND\n                name='Windows_NT-MSVC10-SERIAL_DEBUG_DEV' AND\n                starttime BETWEEN '2011-07-22 00:00:00' AND '2011-07-22 23:59:59'");
     remove_build($row['id']);
     // Disable submission processing so that the queue will accumulate.
     $this->addLineToConfig($this->DisableProcessingConfig);
     // Re-submit the Trilinos build.
     $begin = time();
     $this->submitFiles('ActualTrilinosSubmission', true);
     echo 'Submission took ' . (time() - $begin) . " seconds.\n";
     // Re-enable submission processing and enable parallel processing
     $this->removeLineFromConfig($this->DisableProcessingConfig);
     $this->addLineToConfig($this->ParallelProcessingConfig);
     // Submit another file to Trilinos to start the processing loop.
     $file = dirname(__FILE__) . '/data/SubProjectNextPrevious/Build_1.xml';
     $this->submission('Trilinos', $file);
     // Wait for processing to complete.
     $todo = 999;
     $begin = time();
     while ($todo > 0) {
         $row = pdo_single_row_query('SELECT count(1) AS todo
                 FROM submission WHERE status=0 OR status=1');
         $todo = $row['todo'];
         sleep(1);
         if (time() - $begin > 120) {
             $this->fail("Processing took longer than 120 seconds.\n");
             break;
         }
     }
     echo 'Processing took ' . (time() - $begin) . " seconds.\n";
     // Verify the results.
     $this->verifyResults();
     // Clean up by reverting our config settings and deleting the
     // extra build that we created to trigger the processing.
     $this->removeLineFromConfig($this->ParallelProcessingConfig);
     $row = pdo_single_row_query("SELECT build.id FROM build\n                WHERE build.parentid=-1 AND\n                projectid=(SELECT id FROM project WHERE name='Trilinos') AND\n                stamp='20110723-1515-Experimental'");
     remove_build($row['id']);
 }
开发者ID:kitware,项目名称:cdash,代码行数:39,代码来源:test_parallelsubmissions.php

示例15: htmlspecialchars

require_once "filterdataFunctions.php";
@($date = $_GET["date"]);
if ($date != NULL) {
    $date = htmlspecialchars(pdo_real_escape_string($date));
}
@($projectname = $_GET["project"]);
if ($projectname != NULL) {
    $projectname = htmlspecialchars(pdo_real_escape_string($projectname));
}
$start = microtime_float();
$db = pdo_connect("{$CDASH_DB_HOST}", "{$CDASH_DB_LOGIN}", "{$CDASH_DB_PASS}");
pdo_select_db("{$CDASH_DB_NAME}", $db);
if ($projectname == '') {
    $project = pdo_single_row_query("SELECT * FROM project LIMIT 1");
} else {
    $project = pdo_single_row_query("SELECT * FROM project WHERE name='{$projectname}'");
}
checkUserPolicy(@$_SESSION['cdash']['loginid'], $project['id']);
list($previousdate, $currentstarttime, $nextdate) = get_dates($date, $project['nightlytime']);
$xml = begin_XML_for_XSLT();
$xml .= "<title>CDash : " . $project['name'] . "</title>";
$xml .= get_cdash_dashboard_xml_by_name($project['name'], $date);
// Filters:
//
$filterdata = get_filterdata_from_request();
$filter_sql = $filterdata['sql'];
$limit_sql = '';
if ($filterdata['limit'] > 0) {
    $limit_sql = ' LIMIT ' . $filterdata['limit'];
}
$xml .= $filterdata['xml'];
开发者ID:rpshaw,项目名称:CDash,代码行数:31,代码来源:queryTests.php


注:本文中的pdo_single_row_query函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。