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


PHP doCmdT函数代码示例

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


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

示例1: execCmds

function execCmds()
{
    global $commands;
    for ($i = 0; isset($commands[$i]); $i++) {
        doCmdT($commands[$i][0], $commands[$i][1]);
    }
}
开发者ID:MarkVLK,项目名称:pfsense-packages,代码行数:7,代码来源:status_ospfd.php

示例2: array

$commands = array();
defCmdT("summary", "OpenBGPD Summary", "/usr/local/sbin/bgpctl show summary");
defCmdT("interfaces", "OpenBGPD Interfaces", "/usr/local/sbin/bgpctl show interfaces");
defCmdT("routing", "OpenBGPD Routing", "/usr/local/sbin/bgpctl show rib", true, 4);
defCmdT("forwarding", "OpenBGPD Forwarding", "/usr/local/sbin/bgpctl show fib", true, 5);
defCmdT("network", "OpenBGPD Network", "/usr/local/sbin/bgpctl show network");
defCmdT("nexthops", "OpenBGPD Nexthops", "/usr/local/sbin/bgpctl show nexthop");
defCmdT("ip", "OpenBGPD IP", "/usr/local/sbin/bgpctl show ip bgp", true, 4);
defCmdT("neighbors", "OpenBGPD Neighbors", "/usr/local/sbin/bgpctl show neighbor");
if (isset($_REQUEST['isAjax'])) {
    if (isset($_REQUEST['cmd']) && isset($commands[$_REQUEST['cmd']])) {
        echo "{$_REQUEST['cmd']}\n";
        if (isset($_REQUEST['count'])) {
            echo " of " . countCmdT($commands[$_REQUEST['cmd']]['command']) . " items";
        } else {
            echo htmlspecialchars_decode(doCmdT($commands[$_REQUEST['cmd']]['command'], $_REQUEST['limit'], $_REQUEST['filter'], $_REQUEST['header_size']));
        }
    }
    exit;
}
$pgtitle = array("OpenBGPD", "Status");
include "head.inc";
function doCmdT($command, $limit = "all", $filter = "", $header_size = 0)
{
    $grepline = "";
    if (!empty($filter)) {
        $ini = $header_size > 0 ? $header_size + 1 : 1;
        $grepline = " | /usr/bin/sed -e '{$ini},\$ { /" . escapeshellarg(htmlspecialchars($filter)) . "/!d; };'";
    }
    if (is_numeric($limit) && $limit > 0) {
        $limit += $header_size;
开发者ID:LFCavalcanti,项目名称:pfsense-packages,代码行数:31,代码来源:openbgpd_status.php


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