diotteo / telnetclient.php Goto Github PK
View Code? Open in Web Editor NEWA TELNET client class in PHP
License: Other
A TELNET client class in PHP
License: Other
Its about the function count().
If made this change, its fine to go:
} while ($is_get_more_data || call_user_func_array($get_more_data_cb, array((is_countable($data) && count($data)), $c, &$userData)));
But PHP < 7, doesnt have this funcion is_countable().
And i use this on top of the class:
if (!function_exists('is_countable')) {
function is_countable($var) {
return (is_array($var) || $var instanceof Countable);
}
}
Any ideas ?
Great Work ;)
hello sir
how to fix timed out?
timed out because lots of data array on my device but if the data is little its working
I use this package but when running, the error 'Login Failed' appears.
The Server have 3 steps for this command:
Login Prompt is OK!
1 cmd
epon>enable
2 cmd
epon#configure terminal
3 cmd
epon(config)#show onu-status
Gives alway timed out!
Sample code:
$prompt = "epon>";
$telnet = new TelnetClient($OLT_REMOTE_IP, $OLT_TCP_PORT);
$telnet->connect();
$telnet->setPrompt($prompt); //setRegexPrompt() to use a regex
$telnet->setPruneCtrlSeq(true); //Enable this to filter out ANSI control/escape sequences
$telnet->login($username, $password, $loginPrompt, $passPrompt);
$telnet->sendCommand('enable');
sleep(1);
$telnet->sendCommand('configure terminal');
sleep(1);
$telnet->sendCommand('show onu-status');
do {
$line = $telnet->getLine($matchesPrompt);
//print($line).'@<br>';
$linha .= $line;
} while (!$matchesPrompt);
Stops with timed out. Any help ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.