Skip to content

Commit e74f1b2

Browse files
committed
up
1 parent 94d0430 commit e74f1b2

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

examples/telnet.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
/**
3+
* usage: php examples/telnet.php 127.0.0.1 4730
4+
*/
5+
6+
error_reporting(E_ALL | E_STRICT);
7+
8+
require dirname(__DIR__) . '/../../autoload.php';
9+
date_default_timezone_set('Asia/Shanghai');
10+
11+
global $argv;
12+
$opts = getopt('h', ['help']);
13+
14+
if (isset($opts['h']) || isset($opts['help'])) {
15+
$script = array_shift($argv);
16+
$script = \Inhere\Library\Helpers\Cli::color($script, 'light_green');
17+
$help = <<<EOF
18+
Start a telnet client.
19+
20+
Usage:
21+
$script HOST [PORT]
22+
23+
Options:
24+
-h,--help Show this help information
25+
\n
26+
EOF;
27+
exit($help);
28+
}
29+
30+
$host = $argv[1] ?? '127.0.0.1';
31+
$port = $argv[2] ?? 80;
32+
33+
printf("Connect to the server {$host}:{$port}");
34+
35+
$tt = new \Inhere\LibraryPlus\Network\Telnet($host, $port);
36+
37+
// var_dump($tt);die;
38+
39+
//echo $tt->command('status');
40+
$tt->interactive();

libs/log/ProcessLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
/**
1616
* Class ProcessLogger
17-
* @package inhere\process
17+
* @package Inhere\process
1818
*/
1919
class ProcessLogger implements ProcessLogInterface
2020
{

0 commit comments

Comments
 (0)