avin/telnet-commander 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

avin/telnet-commander

Composer 安装命令:

composer require avin/telnet-commander

包简介

Send packets of commands to your telnet devices

关键字:

README 文档

README

Library to easy send packets of commands to your telnet based devices and recieve answers for processing

  • Send commands to device
  • Setup needful promt regexp
  • Read answers

Example

In this example we login to DLink DES-3200, change time-zone and check results

$host = "192.168.1.10";
$host = 23;

$username = 'john';
$password = 'secretpass'

$commands = [
    ['command' => $username, 'promt' => '/username:$/i'],
    ['command' => $password, 'promt' => '/password:$/i'],
    ['command' => "enable admin", 'promt' => '/#$/i'],
    ['command' => "mysecretpass", 'promt' => '/PassWord:$|#$/i'],
    ['command' => "config time_zone operator + hour 3 min 0", 'promt' => '/#$/i'],
    ['command' => "show time", 'promt' => '/#$/i'],
    ['command' => "", 'promt' => '/#$/i'],
];

try {
        //Setup connection
        $commander = new TelnetCommander($host, $port);
        $commander->setHasAuth(false);
        $commander->connect();

        //Set commands
        $commander->setCommands($commands);

        //Execute commands
        $data = $commander->processCommands();

        /*
        Process $data if you need...
        */

    } catch (Exception $e) {
        echo $e->getMessage();
    }

统计信息

  • 总下载量: 42
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-10-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固