PHPackages                             borisuu/laravel-telnet - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. borisuu/laravel-telnet

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

borisuu/laravel-telnet
======================

A client for writing/reading commands to a host over telnet.

43.6k—0%5[3 issues](https://github.com/borisuu/laravel-telnet/issues)PHP

Since Oct 16Pushed 5y agoCompare

[ Source](https://github.com/borisuu/laravel-telnet)[ Packagist](https://packagist.org/packages/borisuu/laravel-telnet)[ RSS](/packages/borisuu-laravel-telnet/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

TelnetClient.php
================

[](#telnetclientphp)

Update 08.10.2020 - borisuu: I've made this a composer package for easier install into other projects. No code changes made.

Telnet client implementation in PHP.

This code is based on but was completely rewritten. I tried to keep interface compatibility as much as possible.

Things that I know not to work the same anymore:

- Using the constructor with more than 2 arguments, the meaning and order of subsequent parameters have changed
- Line endings should always be returned to the caller as "\\n" but this guarantee is based on the assumption of a correct server implementation (one that encodes line endings as &lt;CR&gt; &lt;LF&gt; in the default (text) state)
- buffer and global\_buffer as well as their associated methods are gone
- The constructor no longer does a connect() call
- The subclassing interface is probably broken (I couldn't keep the getBuffer() method without skipping the state machine)

Many things are still wrong (though it was like that in upstream versions too):

- we DONT/WONT Suppress Go Ahead, Echo and Linemode but expect them to work, etc.

Usage example:
--------------

[](#usage-example)

```
use Borisuu\Telnet\TelnetClient;

//Uncomment this to get debug logging
//TelnetClient::setDebug(true);

$telnet = new TelnetClient('127.0.0.1', 23);
$telnet->connect();
$telnet->setPrompt('$'); //setRegexPrompt() to use a regex
//$telnet->setPruneCtrlSeq(true); //Enable this to filter out ANSI control/escape sequences
$telnet->login('telnetuser', 'weak');

$cmdResult = $telnet->exec('ls /');

$telnet->disconnect();

print("The contents of / is: \"{$cmdResult}\"\n");
```

Alternatively, have a look at testTelnet.php:

```
$ ./testTelnet.php -h
$ ./testTelnet.php -u telnetuser -p weak -H 127.0.0.1 -P 23 -c "ls /"
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance5

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 89% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34666518?v=4)[borisuu](/maintainers/borisuu)[@borisuu](https://github.com/borisuu)

---

Top Contributors

[![diotteo](https://avatars.githubusercontent.com/u/5789496?v=4)](https://github.com/diotteo "diotteo (161 commits)")[![ngharo](https://avatars.githubusercontent.com/u/1051454?v=4)](https://github.com/ngharo "ngharo (11 commits)")[![borisuu](https://avatars.githubusercontent.com/u/34666518?v=4)](https://github.com/borisuu "borisuu (6 commits)")[![FrittenKeeZ](https://avatars.githubusercontent.com/u/1186125?v=4)](https://github.com/FrittenKeeZ "FrittenKeeZ (2 commits)")[![AustP](https://avatars.githubusercontent.com/u/2007045?v=4)](https://github.com/AustP "AustP (1 commits)")

### Embed Badge

![Health badge](/badges/borisuu-laravel-telnet/health.svg)

```
[![Health](https://phpackages.com/badges/borisuu-laravel-telnet/health.svg)](https://phpackages.com/packages/borisuu-laravel-telnet)
```

###  Alternatives

[sarhan/php-flatten

Flattens multidimensional arrays, traversables and vars into one dimensional array.

21177.7k1](/packages/sarhan-php-flatten)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
