本文整理汇总了PHP中show_result函数的典型用法代码示例。如果您正苦于以下问题:PHP show_result函数的具体用法?PHP show_result怎么用?PHP show_result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了show_result函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle_result
function handle_result($resultid)
{
$r = BoincResult::lookup_id($resultid);
$w = BoincWorkunit::lookup_id($r->workunitid);
$rs = BoincResult::enum("workunitid={$r->workunitid} and validate_state=1");
$app_version_ids = array();
foreach ($rs as $r) {
show_result($r, $w);
$app_version_ids[] = $r->app_version_id;
}
$app_version_ids = array_unique($app_version_ids);
foreach ($app_version_ids as $avid) {
show_av($avid);
}
}
示例2: run_test
//.........这里部分代码省略.........
} else {
$borked = false;
}
} else {
if (@count($section_text['FILE']) + @count($section_text['FILEEOF']) + @count($section_text['FILE_EXTERNAL']) != 1) {
$bork_info = "missing section --FILE--";
$borked = true;
}
if (@count($section_text['FILEEOF']) == 1) {
$section_text['FILE'] = preg_replace("/[\r\n]+\$/", '', $section_text['FILEEOF']);
unset($section_text['FILEEOF']);
}
if (@count($section_text['FILE_EXTERNAL']) == 1) {
// don't allow tests to retrieve files from anywhere but this subdirectory
$section_text['FILE_EXTERNAL'] = dirname($file) . '/' . trim(str_replace('..', '', $section_text['FILE_EXTERNAL']));
if (file_exists($section_text['FILE_EXTERNAL'])) {
$section_text['FILE'] = file_get_contents($section_text['FILE_EXTERNAL']);
unset($section_text['FILE_EXTERNAL']);
} else {
$bork_info = "could not load --FILE_EXTERNAL-- " . dirname($file) . '/' . trim($section_text['FILE_EXTERNAL']);
$borked = true;
}
}
if (@count($section_text['EXPECT']) + @count($section_text['EXPECTF']) + @count($section_text['EXPECTREGEX']) != 1) {
$bork_info = "missing section --EXPECT--, --EXPECTF-- or --EXPECTREGEX--";
$borked = true;
}
}
}
fclose($fp);
$shortname = str_replace($cwd . '/', '', $file);
$tested_file = $shortname;
if ($borked) {
show_result("BORK", $bork_info, $tested_file);
$PHP_FAILED_TESTS['BORKED'][] = array('name' => $file, 'test_name' => '', 'output' => '', 'diff' => '', 'info' => "{$bork_info} [{$file}]");
return 'BORKED';
}
$tested = trim($section_text['TEST']);
/* For GET/POST tests, check if cgi sapi is available and if it is, use it. */
if (!empty($section_text['GET']) || !empty($section_text['POST']) || !empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi . ' -C ';
} else {
if (!strncasecmp(PHP_OS, "win", 3) && file_exists(dirname($php) . "/php-cgi.exe")) {
$old_php = $php;
$php = realpath(dirname($php) . "/php-cgi.exe") . ' -C ';
} else {
if (file_exists(dirname($php) . "/../../sapi/cgi/php-cgi")) {
$old_php = $php;
$php = realpath(dirname($php) . "/../../sapi/cgi/php-cgi") . ' -C ';
} else {
if (file_exists("./sapi/cgi/php-cgi")) {
$old_php = $php;
$php = realpath("./sapi/cgi/php-cgi") . ' -C ';
} else {
show_result('SKIP', $tested, $tested_file, "reason: CGI not available");
return 'SKIPPED';
}
}
}
}
}
show_test($test_idx, $shortname);
if (is_array($IN_REDIRECT)) {
$temp_dir = $test_dir = $IN_REDIRECT['dir'];
示例3: show_platform
show_platform($res);
break;
case "app":
show_app($res);
break;
case "app_version":
show_app_version($res);
break;
case "host":
show_host($res);
break;
case "workunit":
show_workunit($res);
break;
case "result":
show_result($res);
break;
case "team":
show_team($res);
break;
case "user":
show_user($res);
break;
}
}
}
if ($detail == "low" || $table == "profile") {
end_table();
}
mysql_free_result($result);
} else {
示例4: run_test
//.........这里部分代码省略.........
} else {
if (!isset($section_text['PHPDBG']) && @count($section_text['FILE']) + @count($section_text['FILEEOF']) + @count($section_text['FILE_EXTERNAL']) != 1) {
$bork_info = "missing section --FILE--";
$borked = true;
}
if (@count($section_text['FILEEOF']) == 1) {
$section_text['FILE'] = preg_replace("/[\r\n]+\$/", '', $section_text['FILEEOF']);
unset($section_text['FILEEOF']);
}
foreach (array('FILE', 'EXPECT', 'EXPECTF', 'EXPECTREGEX') as $prefix) {
$key = $prefix . '_EXTERNAL';
if (@count($section_text[$key]) == 1) {
// don't allow tests to retrieve files from anywhere but this subdirectory
$section_text[$key] = dirname($file) . '/' . trim(str_replace('..', '', $section_text[$key]));
if (file_exists($section_text[$key])) {
$section_text[$prefix] = file_get_contents($section_text[$key], FILE_BINARY);
unset($section_text[$key]);
} else {
$bork_info = "could not load --" . $key . "-- " . dirname($file) . '/' . trim($section_text[$key]);
$borked = true;
}
}
}
if (@count($section_text['EXPECT']) + @count($section_text['EXPECTF']) + @count($section_text['EXPECTREGEX']) != 1) {
$bork_info = "missing section --EXPECT--, --EXPECTF-- or --EXPECTREGEX--";
$borked = true;
}
}
}
fclose($fp);
$shortname = str_replace($cwd . '/', '', $file);
$tested_file = $shortname;
if ($borked) {
show_result("BORK", $bork_info, $tested_file);
$PHP_FAILED_TESTS['BORKED'][] = array('name' => $file, 'test_name' => '', 'output' => '', 'diff' => '', 'info' => "{$bork_info} [{$file}]");
junit_mark_test_as('BORK', $shortname, $tested_file, 0, $bork_info);
return 'BORKED';
}
if (isset($section_text['CAPTURE_STDIO'])) {
$captureStdIn = stripos($section_text['CAPTURE_STDIO'], 'STDIN') !== false;
$captureStdOut = stripos($section_text['CAPTURE_STDIO'], 'STDOUT') !== false;
$captureStdErr = stripos($section_text['CAPTURE_STDIO'], 'STDERR') !== false;
} else {
$captureStdIn = true;
$captureStdOut = true;
$captureStdErr = true;
}
if ($captureStdOut && $captureStdErr) {
$cmdRedirect = ' 2>&1';
} else {
$cmdRedirect = '';
}
$tested = trim($section_text['TEST']);
/* For GET/POST/PUT tests, check if cgi sapi is available and if it is, use it. */
if (!empty($section_text['GET']) || !empty($section_text['POST']) || !empty($section_text['GZIP_POST']) || !empty($section_text['DEFLATE_POST']) || !empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || !empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi . ' -C ';
} else {
if (!strncasecmp(PHP_OS, "win", 3) && file_exists(dirname($php) . "/php-cgi.exe")) {
$old_php = $php;
$php = realpath(dirname($php) . "/php-cgi.exe") . ' -C ';
} else {
if (file_exists(dirname($php) . "/../../sapi/cgi/php-cgi")) {
$old_php = $php;
$php = realpath(dirname($php) . "/../../sapi/cgi/php-cgi") . ' -C ';
示例5: get_int
// Copyright (C) 2008 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// show a result
require_once "../inc/util.inc";
require_once "../inc/result.inc";
$x = get_int("resultid", true);
if ($x) {
$result = BoincResult::lookup_id($x);
} else {
$x = get_str("result_name");
$result = BoincResult::lookup_name($x);
}
if (!$result) {
error_page(tra("No such task:") . " " . htmlspecialchars($x));
// the htmlspecialchars prevents XSS
}
page_head(tra("Task") . " " . htmlspecialchars($x));
show_result($result);
page_tail();
示例6: while
while (list($brgy_id, $brgy_name) = mysql_fetch_array($q_brgy)) {
if ($brgy_name == $_GET["brgy"]) {
echo "<option value='{$brgy_id}' SELECTED>{$brgy_name}</option>";
} else {
echo "<option value='{$brgy_id}'>{$brgy_name}</option>";
}
}
echo "</select>";
echo "</td>";
echo "</tr>";
echo "<tr><td colspan='2' align='center'>";
echo "<input type='submit' name='submit_search' value='Search Relatives'></input>";
echo "</td></tr>";
echo "</table>";
echo "</form>";
show_result();
insert_select_patient();
} else {
echo "<font color='red'>Please login to access the Mobile Midwife Synchronization interfaces</font>";
}
function show_result()
{
$arr_family_id = array();
if ($_POST["submit_search"] == "Search Relatives") {
//print_r($_POST);
$q_family = mysql_query("SELECT DISTINCT a.family_id FROM m_family_members a, m_patient b, m_family_address c, m_lib_barangay d WHERE a.patient_id=b.patient_id AND b.patient_lastname='{$_POST['txt_lname']}' AND b.patient_id!='{$_GET['pxid']}'") or die("Cannot query 57: " . mysql_error());
if (mysql_num_rows($q_family) == 0) {
echo "<script language='Javascript'>";
echo "if(window.confirm('No family with the surname " . strtoupper($_POST[txt_lname]) . " was found. Do you wish to return to the previous window? Otherwise, press Cancel and search another surname.')){";
echo "window.close()";
echo "}";
示例7: show_result
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="messageStackSuccess">
<font size="1">
';
if ($import) {
show_result($result, 'prod_new', TEXT_RESULT_P_NEW);
if ($not_is_customers) {
show_result($result, 'prod_upd', TEXT_RESULT_P_CHANGED);
show_result($result, 'cat_new', TEXT_RESULT_C_NEW);
show_result($result, 'cat_upd', TEXT_RESULT_C_UPDATED);
show_result($result, 'cat_touched', TEXT_RESULT_C_CHANGED);
}
} else {
if ($export) {
show_result($result, 'prod_exp', TEXT_RESULT_P_EXPORTED);
}
}
if (isset($time)) {
$main_content .= $time;
}
$main_content .= HTML_BR . HTML_BR . '
</font>
</td>
</tr>
</table>';
if ($import) {
$n = count($import->result[1]);
if ($n) {
$main_content .= '
<table width="100%" border="0" cellspacing="0" cellpadding="0">
示例8: show_result
<?php
$id = $_POST["id"];
$refer_db_name = $_POST["refer_name"];
$cond_values_str = $_POST["cond_values_str"];
include "../user_conf/query_conf.php";
include "../user_conf/db_conf.php";
include "../user_conf/func_result_conf.php";
include "../user_conf/convert_func_list.php";
show_result($id, $refer_db_name, $cond_values_str);
function build_schema_file($sub_arr)
{
global $conf_list;
$host = $sub_arr["db_host"];
$port = $sub_arr["db_port"];
$db_name = $sub_arr["db_name"];
$table_name = $sub_arr["table_name"];
list($username, $passwd) = $conf_list[$host . ":" . $port];
$schema_file = "schema-list/{$host}-{$port}-{$db_name}-{$table_name}.php";
if (!file_exists($schema_file)) {
$conn = mysql_connect("{$host}:{$port}", $username, $passwd) or die("Could not connect: " . mysql_error());
mysql_select_db($db_name, $conn);
$result = mysql_query("DESC {$table_name}", $conn) or die("无效的查询条件: " . mysql_error());
$handle = fopen($schema_file, "w");
fwrite($handle, "<?php\n");
fwrite($handle, "\$schema_arr = Array(\n");
while ($row = mysql_fetch_assoc($result)) {
$user_name = $row["Field"];
$type = $row["Type"];
fwrite($handle, "\t\"{$user_name}\" => \"{$type}\",\n") or die("不能写入到文件 {$schema_file}");
}
示例9: show_step_type
?>
<li class="tbody">
<span style="width:90px;" class="text-center"><?php
echo show_step_type($item["step"]);
?>
</span>
<span style="width:90px;" class="text-center"><?php
echo $item["user_name"];
?>
</span>
<span style="width:90px;" class="text-center"><?php
echo todate($item["create_time"], 'Y-m-d');
?>
</span>
<span style="width:90px;" class="text-center"><?php
echo show_result($item["result"]);
?>
</span>
<span class="auto">
<div style="overflow:hidden">
<?php
echo $item["comment"];
?>
</div> </span>
</li><?php
}
}
} else {
echo "";
}
?>
示例10: foreach
<li>
<div class="checkbox">
<input type="checkbox" name="cincoEstrella" value="1">
<span class="glyphicon glyphicon-star" aria-hidden="true"></span>
<span class="glyphicon glyphicon-star" aria-hidden="true"></span>
<span class="glyphicon glyphicon-star" aria-hidden="true"></span>
<span class="glyphicon glyphicon-star" aria-hidden="true"></span>
<span class="glyphicon glyphicon-star" aria-hidden="true"></span>
</div>
</li>
</ul>
</div>
</div>
</div>
<div id="resultados" class="col-md-9" style="text-align: left">
<?php
if (count($results) != 0) {
foreach ($results as $result) {
echo show_result($result);
}
} else {
echo '<h3>No se encontraron resultados</h3>';
}
?>
</div>
</div>
</div>
</div>
</div>
</section>
示例11: show_result
<div class="tab-content">
<div id="home" class="tab-pane fade in active">
<h3 style="text-align: left;">Actividades</h3>
<?php
echo '<a href="' . $createActivity . '" style="text-align: right;">';
echo $OUTPUT->pix_icon('t/addfile', 'Crear una actividad');
echo ' Crear una actividad</a>';
if ($countActivities == 1) {
echo show_result($activities);
} elseif ($countActivities > 1) {
foreach ($activities as $activity) {
echo show_result($activity);
}
} else {
echo "<h3>Aún no has creado actividades...</h3>";
}
?>
</div>
<div id="menu1" class="tab-pane fade">
<h3 style="text-align: left;">Rúbricas</h3>
<?php
if ($countRubrics == 1) {
$rubric = $DB->get_record('grading_definitions', array('usercreated' => $USER->id));
echo '<div class="panel panel-default">';
示例12: run_test
//.........这里部分代码省略.........
$post = trim($section_text['POST']);
if (array_key_exists('GZIP_POST', $section_text) && function_exists('gzencode')) {
$post = gzencode($post, 9, FORCE_GZIP);
$env['HTTP_CONTENT_ENCODING'] = 'gzip';
} else {
if (array_key_exists('DEFLATE_POST', $section_text) && function_exists('gzcompress')) {
$post = gzcompress($post, 9);
$env['HTTP_CONTENT_ENCODING'] = 'deflate';
}
}
//save_text($tmp_post, $post);
$content_length = strlen($post);
$env['REQUEST_METHOD'] = 'POST';
$env['CONTENT_TYPE'] = 'application/x-www-form-urlencoded';
$env['CONTENT_LENGTH'] = $content_length;
$opts["http"]["method"] = "POST";
$opts["http"]["header"] .= "Content-type: " . $env['CONTENT_TYPE'] . "\r\n";
$opts["http"]["header"] .= "Content-encoding: " . $env['HTTP_CONTENT_ENCODING'] . "\r\n";
$opts["http"]["header"] .= "Content-length: " . $content_length . "\r\n";
$opts["http"]["content"] = $post;
} else {
$env['REQUEST_METHOD'] = 'GET';
$env['CONTENT_TYPE'] = '';
$env['CONTENT_LENGTH'] = '';
}
}
$context = stream_context_create($opts);
$out = _file_get_contents($www . $phpfile, false, $context, &$headers);
if ($out === FALSE) {
echo '<br/>';
error("See <a target='_blank' href='{$phpfile}'>{$phpfile}</a>, exception ");
}
if (StartsWith($out, "\r\nCompileError") || StartsWith($out, "\r\nCompileWarning")) {
show_result("<span class='skip'>SKIP</span>", $file, ", Script generates <b>CompileError</b> or <b>CompileWarning</b>, so it cannot be compared with PHP. <a href='{$phpfile}' target='_blank'>Try the script</a><pre>{$out}</pre>");
}
// perform clean
try_clean($file, $www, $section_text);
// compare .php response with expected output
// Does the output match what is expected?
$output = preg_replace("/\r\n/", "\n", trim($out));
$output = str_replace("string[binary](", "string(", $output);
$failed_headers = false;
if (isset($section_text['EXPECTHEADERS'])) {
$want = array();
$wanted_headers = array();
$lines = preg_split("/[\n\r]+/", (string) $section_text['EXPECTHEADERS']);
foreach ($lines as $line) {
if (strpos($line, ':') !== false) {
$line = explode(':', $line, 2);
$want[trim($line[0])] = trim($line[1]);
$wanted_headers[] = trim($line[0]) . ': ' . trim($line[1]);
}
}
$org_headers = $headers;
$headers = array();
$output_headers = array();
foreach ($want as $k => $v) {
if (isset($org_headers[$k])) {
$headers = $org_headers[$k];
$output_headers[] = $k . ': ' . $org_headers[$k];
}
if (!isset($org_headers[$k]) || $org_headers[$k] != $v) {
$failed_headers = true;
}
}
ksort($wanted_headers);
示例13: show_result
<?php
function show_result($a, $b)
{
$result = $a + $b;
echo "{$a} + {$b} = <b>{$result}</b><br>";
echo '<a href=sum.php>Еще разок</a>';
}
if (isset($_POST['a']) && isset($_POST['b'])) {
show_result($_POST['a'], $_POST['b']);
} else {
include 'form_sum.php';
}
示例14: run_test
function run_test($php, $file, $env)
{
global $log_format, $info_params, $ini_overwrites, $cwd, $PHP_FAILED_TESTS;
global $pass_options, $DETAILED, $IN_REDIRECT, $test_cnt, $test_idx;
global $leak_check, $temp_source, $temp_target, $cfg, $environment;
global $no_clean;
$temp_filenames = null;
$org_file = $file;
if (isset($env['TEST_PHP_CGI_EXECUTABLE'])) {
$php_cgi = $env['TEST_PHP_CGI_EXECUTABLE'];
}
if (is_array($file)) {
$file = $file[0];
}
if ($DETAILED) {
echo "\n=================\nTEST {$file}\n";
}
// Load the sections of the test file.
$section_text = array('TEST' => '', 'SKIPIF' => '', 'GET' => '', 'POST_RAW' => '', 'POST' => '', 'UPLOAD' => '', 'ARGS' => '');
$fp = @fopen($file, "rt") or error("Cannot open test file: {$file}");
$borked = false;
$bork_info = '';
if (!feof($fp)) {
$line = fgets($fp);
} else {
$bork_info = "empty test [{$file}]";
$borked = true;
}
if (!ereg('^--TEST--', $line, $r)) {
$bork_info = "tests must start with --TEST-- [{$file}]";
$borked = true;
}
$section = 'TEST';
$secfile = false;
$secdone = false;
while (!feof($fp)) {
$line = fgets($fp);
// Match the beginning of a section.
if (preg_match('/^--([A-Z_]+)--/', $line, $r)) {
$section = $r[1];
$section_text[$section] = '';
$secfile = $section == 'FILE' || $section == 'FILEEOF';
$secdone = false;
continue;
}
// Add to the section text.
if (!$secdone) {
$section_text[$section] .= $line;
}
// End of actual test?
if ($secfile && preg_match('/^===DONE===/', $line, $r)) {
$secdone = true;
}
}
// the redirect section allows a set of tests to be reused outside of
// a given test dir
if (@count($section_text['REDIRECTTEST']) == 1) {
if ($IN_REDIRECT) {
$borked = true;
$bork_info = "Can't redirect a test from within a redirected test";
} else {
$borked = false;
}
} else {
if (@count($section_text['FILE']) + @count($section_text['FILEEOF']) != 1) {
$bork_info = "missing section --FILE--";
$borked = true;
}
if (@count($section_text['FILEEOF']) == 1) {
$section_text['FILE'] = preg_replace("/[\r\n]+\$/", '', $section_text['FILEEOF']);
unset($section_text['FILEEOF']);
}
if (@count($section_text['EXPECT']) + @count($section_text['EXPECTF']) + @count($section_text['EXPECTREGEX']) != 1) {
$bork_info = "missing section --EXPECT--, --EXPECTF-- or --EXPECTREGEX--";
$borked = true;
}
}
fclose($fp);
$shortname = str_replace($cwd . '/', '', $file);
$tested_file = $shortname;
if ($borked) {
show_result("BORK", $bork_info, $tested_file);
$PHP_FAILED_TESTS['BORKED'][] = array('name' => $file, 'test_name' => '', 'output' => '', 'diff' => '', 'info' => "{$bork_info} [{$file}]");
return 'BORKED';
}
$tested = trim($section_text['TEST']);
/* For GET/POST tests, check if cgi sapi is available and if it is, use it. */
if (!empty($section_text['GET']) || !empty($section_text['POST']) || !empty($section_text['POST_RAW'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi . ' -C ';
} elseif (!strncasecmp(PHP_OS, "win", 3) && file_exists(dirname($php) . "/php-cgi.exe")) {
$old_php = $php;
$php = realpath(dirname($php) . "/php-cgi.exe") . ' -C ';
} elseif (file_exists("./sapi/cgi/php")) {
$old_php = $php;
$php = realpath("./sapi/cgi/php") . ' -C ';
} else {
show_result("SKIP", $tested, $tested_file, "reason: CGI not available");
return 'SKIPPED';
//.........这里部分代码省略.........
示例15: flow_todo
function flow_todo($flow_type)
{
//我的待办流程
$uid = get_user_id();
$str = "";
$where['type'] = array('in', $flow_type);
$flow_todo_list = M("Flow")->where($where)->getField('id name,id');
$where_log['result'] = array("in", "3");
// 未完成
$where_log['user_id'] = $uid;
$where_log['flow_id'] = array('in', $flow_todo_list);
$flow_list = M("FlowLog")->where($where_log)->order('id desc')->select();
$count = M("FlowLog")->where($where_log)->count();
for ($i = 0; $i < $count; $i++) {
$flow = M("Flow")->where('id=' . $flow_list[$i]['flow_id'])->find();
$str = $str . "\n\t\t\t\t\t<li> <a href=" . __APP__ . "/flow/read?id=" . $flow_list[$i]['flow_id'] . " title=>【" . $flow_list[$i]['user_name'] . "】 " . $flow['name'] . " " . show_result($flow_list[$i]['result']) . " </a></li>";
}
return $str;
}