本文整理汇总了PHP中Export::setDB方法的典型用法代码示例。如果您正苦于以下问题:PHP Export::setDB方法的具体用法?PHP Export::setDB怎么用?PHP Export::setDB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Export
的用法示例。
在下文中一共展示了Export::setDB方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: basicFeautures
//.........这里部分代码省略.........
$total = 0;
} else {
$total = 1;
}
if ($resp = $search->statisticUserAgent($data, $total)) {
$answer['status'] = 'ok';
$answer['data'] = $resp;
} else {
$answer['status'] = 'not good';
$answer['data'] = array();
}
break;
case 'alarm/data/all':
case 'alarm/data/total':
case 'alarm/data/short':
$reqkey = preg_replace('/alarm\\/data\\//', '', $obj->getRURI());
if ($reqkey == "all") {
$total = 0;
} else {
if ($reqkey == "short") {
$total = 2;
} else {
$total = 1;
}
}
if ($resp = $search->alarmData($data, $total)) {
$answer['status'] = 'ok';
$answer['data'] = $resp;
} else {
$answer['status'] = 'not good';
$answer['data'] = array();
}
break;
case 'alarm/update':
if ($resp = $search->replaceAlarm($data)) {
$answer['status'] = 'ok';
$answer['data'] = $resp;
} else {
$answer['status'] = 'not good';
$answer['data'] = array();
}
break;
case 'alarm/delete':
if ($resp = $search->deleteAlarm($data)) {
$answer['status'] = 'ok';
$answer['data'] = $resp;
} else {
$answer['status'] = 'not good';
$answer['data'] = array();
}
break;
case 'alarm/delete/all':
if ($resp = $search->deleteAllAlarms()) {
$answer['status'] = 'ok';
$answer['data'] = $resp;
} else {
$answer['status'] = 'not good';
$answer['data'] = array();
}
break;
case 'alarm/ack/all':
console . log("Want to ACK all alarms");
if ($resp = $search->ackAllAlarms()) {
$answer['status'] = 'ok';
$answer['data'] = $resp;
} else {
$answer['status'] = 'not good';
$answer['data'] = array();
}
break;
case 'export/pcap/callid':
case 'export/text/callid':
include_once "class/pcap.php";
/* Call Search */
$export = new Export();
$export->setDB($db);
$text = 0;
if ($obj->getRURI() == "export/text/callid") {
$text = 1;
}
$resp = $export->generatePcap($data, $text);
if (!empty($resp)) {
sendFile(200, $resp[0], $resp[1], $resp[2]);
exit;
} else {
$answer['status'] = 'ok';
$answer['data'] = array();
exit;
}
break;
/* ALARMS */
/* ALARMS */
default:
$answer['status'] = 'not good';
$answer['message'] = 'Unknown get call: [' . $request . ']';
$answer['data'] = array();
break;
}
return $answer;
}