Download the PHP package marbocub/network-equipment without Composer

On this page you can find all versions of the php package marbocub/network-equipment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package network-equipment

marbocub/network-equipment

A telnet client with response parser for network equipment written in PHP.

This library provide two features.

The parser is implemented as the integrated with telnet client and as the standalone library. If you want to use your own telnet/SSH client library, you can use the parser as standalone library.

Supported network equipment

Supported network equipment by the parser and the telnet client are:

Telnet client may work with targeted are:

Supported Cisco IOS commands by the parser

Getting Started

Installing

Via Composer

Quick start example for telnet client

The following example login to a Cisco IOS switch to get and display the interface status:

Quick start example for standalone parser library

The following example parse the "show int status" command response getted from a Cisco IOS switch:

The result of examples

The result of both examples is:

Usage for Telnet Client

Instantiating a client

To instantiation a client, use the TelnetClient::factory() that return a TelnetClient instance:

Connect and Login to the network equipment

To login a network equipment, use the connect() method to create a socket first and then use the login() method:

Note: The difference of connect() between this library and the graze/telnet-client is the preset prompts for Cisco IOS.

Execute command and parse the response

Once connected, the execute() method can be used to write command to the socket and receive the response:

Note: Must be execute "terminal length 0" first for Cisco IOS.

Note: getResponseArray() calls the parser internally. Only works well with supported Cisco IOS command executed.

Turn on privileged mode for Cisco IOS

To enable privileged mode for Cisco IOS, the enable() method can be used:

Batch execute Cisco IOS configure commands (privileged mode must be turned on)

To configure Cisco IOS, the configure() method can be used:

Note: The first argument of the configure() is an array listing the commands to execute.

Custom prompt setting

You can specify the following prompt constant at the 2nd argument of connect().

Usage for Parser

Instantiating a parser

Parse the command response

The first argument of parse() is the executed Cisco IOS command. Required for the parser to select the format.

Limitations

Telnet client of this library requires the PHP's low-level sockets extension (ext-sockets) for the underlying library.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details.


All versions of network-equipment with dependencies

PHP Build Version
Package Version
Requires php Version >= 7.2.0
graze/telnet-client Version ^2.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package marbocub/network-equipment contains the following files

Loading the files please wait ....