Download the PHP package srikanta159/net_routeros_php without Composer
On this page you can find all versions of the php package srikanta159/net_routeros_php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download srikanta159/net_routeros_php
More information about srikanta159/net_routeros_php
Files in srikanta159/net_routeros_php
Package net_routeros_php
Short Description Modern PHP client for MikroTik RouterOS API with complete RouterOS v7 and v6 compatibility
License LGPL-2.1-or-later
Homepage https://github.com/srikanta159/Net_RouterOS_PHP
Informations about the package net_routeros_php
Net_RouterOS_PHP
A modernized PHP API client for MikroTik RouterOS, supporting both RouterOS v7 (including v7.19.4+) and RouterOS v6. Fully compatible with modern PHP (PHP 7.4 through PHP 8.4+).
Why This Package Exists
The original pear2/net_routeros library was abandoned and broke when MikroTik introduced RouterOS v7:
- Authentication Overhaul: RouterOS v6.43+ and v7 introduced direct credential authentication, deprecating the legacy MD5 CHAP challenge-response handshake (
=ret=). Legacy clients fail withInvalid username or password. -
New Response Type (
!empty): RouterOS v7 returns!emptyinstead of empty!reor!donein many queries. Legacy clients crash with: - Modern PHP Deprecations: PHP 8.1, 8.2, 8.3, and 8.4 introduced deprecations for SPL interfaces without return types (
#[\ReturnTypeWillChange]) and dynamic property access.
Net_RouterOS_PHP solves all of these problems while maintaining full backward compatibility with legacy RouterOS v6 devices and existing codebases.
Features
- RouterOS v7 & v6 Dual Support: Automatically detects and handles RouterOS v7 plaintext authentication, with seamless fallback to RouterOS v6 MD5 challenge-response.
- RouterOS v7
!emptyProtocol Handling: Native parsing of!emptyresponse sentences across responses and collections. - PHP 8.x Ready: Zero deprecation notices on PHP 8.1, 8.2, 8.3, and 8.4.
- PSR-4 Autoloading: Standard Composer layout (
src/), with standaloneautoload.phpfallback for non-Composer setups. - Full Encryption Support: Connect securely via TLS/SSL on API port
8729. - Query Builder: Intuitive, chainable syntax for filtering RouterOS commands (
Query::where(...)). - Synchronous & Asynchronous: Support for synchronous blocking requests, asynchronous non-blocking queries, and callbacks.
- Automated Test Suite: Tested across PHP 7.4 to 8.4 on Linux and Windows via GitHub Actions CI.
Requirements
- PHP:
^7.4 || ^8.0 || ^8.1 || ^8.2 || ^8.3 || ^8.4 - Extensions:
ext-iconv(required),ext-openssl(for TLS on port 8729),ext-sockets - Dependency:
pear2/net_transmitter(^1.0@alpha)
Installation
Option 1: Composer (Recommended)
Add the package to your project:
Note: If your root
composer.jsonhasminimum-stability: stable, ensure you add"minimum-stability": "alpha"and"prefer-stable": trueto allowpear2/net_transmitter.
Option 2: Git Clone / Manual Download
Clone the repository into your project:
Include the standalone autoloader:
Quick Start
1. Basic Synchronous Request
2. Encrypted Connection (API-SSL on Port 8729)
3. Filtering with Query Builder
4. Handling RouterOS v7 !empty Responses
Running Tests
Run the built-in test runner without any external test framework:
Or using Composer:
Contributing
Contributions are welcome! Please read CONTRIBUTING.md for details on our code of conduct and development workflow.
License
This package is free and open-source software licensed under the GNU Lesser General Public License v2.1 or later (LGPL-2.1-or-later), with permission granted under LGPL Section 3 to apply the terms of the GNU General Public License.
- Original Author: Vasil Rangelov ([email protected])
- RouterOS v7 & Modern PHP Maintainer: Srikanta Das (@srikanta159)