Download the PHP package lifo/remote-control without Composer
On this page you can find all versions of the php package lifo/remote-control. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package remote-control
Remote Control
"Remote Control" is a PHP class library that allows you to programically control a remote device via its CLI
interface (usually via SSH or Telnet) or any other command via STDIN
and STDOUT
using Expect in an easy to use object oriented manner.
I've based this class design on my own Cisco Automation perl library here on github. However, I've tried to make this library as generic as possible to work with any any process or device.
Development Notes
The PHP Expect library is extremely limited and does not even come close to the perl Expect module available on CPAN
. As of this writing the newest version of php-expect is v0.3.1 (updated almost 2 years ago!). Two main limitations is the way php-expect handles capturing output and pattern matching.
- php-expect supports an INI setting
expect.logfile
to capture output but due to buffering its of limited use in a real-time program that wants to read/write to a process. In order to allow for real-time output capturing I have to constantly set and reset theexpect.logfile
INI setting during runtime. This causes the the file to flush and the class then intelligently knows where to read from the file to determine output from a previous command. I haven't noticed any performance issues with this so far. - php-expect says it supports
REGEXP
style patterns but doesn't clearly state if that is truly PREG patterns or not. In my testing certain patterns cause Segfaults or simply do not work the way you're used to. Most notably is you cannot use modifiers (multi-line: m) and because of that its a little harder to limit prompt matches, etc.
Project Setup
Dependencies
- PHP 5.3+
- Expect PECL extension
Installation
Composer is the recommended way to download and maintain your copy of the library (using packagist.org).
Using Github directly is also a reasonable option, however, you'll have to manually create an autoloader for the classes or include
them on your own (ugly!)
Composer Installation
-
Add "lifo/remote-control" to your project composer.json file:
- Run composer update:
php composer.phar update lifo/remote-control
GitHub Installatin
-
Clone the remote-control repository:
git clone git://github.com/lifo101/remote-control.git
- Add
Lifo/RemoteControl
to your project autoloader as-needed.
Examples
See the examples directory for more runnable examples.
All versions of remote-control with dependencies
ext-expect Version *