fafan/cpanel-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

fafan/cpanel-php

Composer 安装命令:

composer require fafan/cpanel-php

包简介

Cpanel/WHM API for PHP

README 文档

README

Code Climate Test Coverage Issue Count

CPanel/WHM API for PHP library

NOTE: This library is modified from original code of gufy/cpanel-php

I rewrite runQuery() function to use cURL instead of GuzzleHttp

Contents

Installation

To install this package, you can run this code via your terminal

	composer require fafan/cpanel-php

Or update your composer.json by adding this line

	"fafan/cpanel-php":"^0.1"

Then, run this code

	composer update

Usage

For example, if you would like to get list accounts of your whm server, you can do this.

  <?php
  $cpanel = new \Fafan\CpanelPhp\Cpanel([
      'host'        =>  'https://123.456.789.123:2087', // ip or domain complete with its protocol and port
      'username'    =>  'root', // username of your server, it usually root.
      'auth_type'   =>  'hash', // set 'hash' or 'password'
      'password'    =>  'password', // long hash or your user's password
  ]);

  $accounts = $cpanel->listaccts(); // it will returned as array

Functions

This is the example when you want to define your configuration while creating new object

  <?php
  $cpanel = new \Fafan\CpanelPhp\Cpanel([
      'host'        =>  'https://123.456.789.123:2087', // required
      'username'    =>  'root', // required
      'auth_type'   =>  'hash', // optional, default 'hash'
      'password'    =>  'password', // required
  ]);

Somehow, you want to override your current configuration. To do this, here is the code

  <?php
  // change username andd (password or hash)
  $cpanel->setAuthorization($username, $password);

  // change host
  $cpanel->setHost($host);

  // change authentication type
  $cpanel->setAuthType($auth_type);

Get defined configuration

After you define some of your configuration, you can get it again by calling this functions

  <?php
  // get username
  $cpanel->getUsername();

  // get password
  $cpanel->getPassword();

  // get authentication type
  $cpanel->getAuthType();

  // get host
  $cpanel->getHost();

Credits

Original code: gufy/cpanel-php, version 1.0

By Mochamad Gufron mgufronefendi@gmail.com

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-10-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固