eugenevdm / network
一个基本的网络库。
1.0.21
2017-01-30 15:46 UTC
Requires
- eugenevdm/helpers: ^1.0
README
##描述
一个提供各种常见网络功能的 PHP 网络库。
Linux 所有命令列表
- DNS
- 内存
- ping
- traceroute
- 运行时间
- 版本
- whois
安装
composer require eugenevdm/network
示例命令
$result = Network::whois('snowball.co.za'); die(print_r($result, 1));
echo Network::ping('196.25.1.1');
echo Network::traceroute('196.25.1.1');
更多示例请参阅根目录下的 tests.php
。
SSH
SSH 安装
sudo apt-get install php-ssh2 && sudo /etc/init.d/apache2 restart
SSH 使用
$config = \Helpers\Helpers::Config('ssh'); $host = new Linux($config['host'], $config['username'], $config['password']); var_dump ($host->dns());; echo $host->version() . "\n"; echo $host->uptime() . "\n"; echo $host->ping() . "\n";