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


PHP Export::setDB方法代码示例

本文整理汇总了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;
}
开发者ID:linuxmaniac,项目名称:homer,代码行数:101,代码来源:index.php


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