承接 wiardvanrij/serverinfo 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wiardvanrij/serverinfo

Composer 安装命令:

composer require wiardvanrij/serverinfo

包简介

Retreive serverinfo via SSH Wrapper

README 文档

README

Information

This libary uses the "ssh wrapper" : https://github.com/wiardvanrij/sshwrapper as requirement

It provides out of the box functions to retrieve server information. Mostly used for webbased servers on a Linux operating system

Requirements

Please read the sshwrapper library, you will need ssh2 php module.

Installation

Via composer

{
    "require": {
        "wiardvanrij/serverinfo": "^0"
    }
}

or

composer require wiardvanrij/serverinfo

Usage

again please read the sshwrapper for those features

Require the autoloader and include the namespaces

<?php
require_once('vendor/autoload.php');

use SshWrapper\SshCore;
use ServerInfo\ServerCore;

Initiate the class with the host and make a connection

$ssh = new SshCore('123.123.123.123');
$ssh->connect();

Initiate the serverinfo class and pass the connection

$server = new ServerCore($ssh);

Use the functions you desire

Returns the hostname of the server as string

$hostname = $server->getHostname();

Returns the exact PHP version/service on the server. For instance php7.0 or php7.0-fpm etc.

$php      = $server->getPHPServiceName();

Returns an array of the vhosts including domains, vhost location and aliases sorted by port 80 & 443

$data     = $server->getVhosts();     

Example output:

Array
(
    [http] => Array
        (
            [1] => Array
                (
                    [domain] => foo.com
                    [config] => /etc/apache2/sites-enabled/ssl-foo.com.conf
                )
            [2] => Array
                (
                    [domain] => bar.com
                    [config] => /etc/apache2/sites-enabled/ssl-bar.com.conf
                    [aliases] => Array
                        (
                            [0] => foobar.eu
                            [1] => www.barfoo.eu
                        )

                )
        )
    [https] => Array
        (
            [1] => Array
                (
                    [domain] => foo.com
                    [config] => /etc/apache2/sites-enabled/foo.com.conf
                )
            [2] => Array
                (
                    [domain] => bar.com
                    [config] => /etc/apache2/sites-enabled/bar.com.conf
                    [aliases] => Array
                        (
                            [0] => foobar.eu
                            [1] => www.barfoo.eu
                        )
  
                )
         )
)                                      

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固