alaa-hany/awhm
Composer 安装命令:
composer require alaa-hany/awhm
包简介
WHM & Cpanel API with PHP
README 文档
README
Execute WHM and Cpanel operation with API by PHP
Installation
Install the latest version with:
$ composer require alaa-hany/awhm
Requirements
- PHP 7.0 or higher is required
Supported Operations for Now
- WHM
- Accounts
- Get all Cpanel account
- Create new Cpanel user
- Delete Cpanel user
- Get suspensions Cpanel users
- Suspend Cpanel user
- Unsuspend Cpanel user
- Services
- Restart service
- Enable service
- Disable service
- Get service Status
- Get service configuration
- Mail
- Get email accounts of Cpanel user
- Accounts
- Cpanel
- there is not supported operation for now
Basic usage
// All API Calls made throw HTTPS use \Alaa\Awhm\base\WHMClient ; $ipOrDomain = "YOUR_IP_OR_DOMAIN"; // IP is preferred , we take care of get Domain $user = 'root' ; // for example $token = "YOUR_TOKEN" ; // $whmClient = new WHMClient($ipOrDomain , $user , $token); //--------- Accounts ---------// // get All Cpanel users var_dump($whmClient->accountsManagementInstance()->all()); // Create Cpanel users $diskSizeInMegaBytes = 500; // Default unlimited var_dump ($whmClient->accountsManagementInstance()->create("USER_NAME" , "PASSWORD" , $diskSizeInMegaBytes)); // get All suspended Cpanel users var_dump ($whmClient->accountsManagementInstance()->suspensions()); // suspend Cpanel user var_dump ($whmClient->accountsManagementInstance()->suspendCpanelUser("CPANEL_USER_NAME")); // suspend Cpanel users var_dump ($whmClient->accountsManagementInstance()->unsuspendCpanelUser("CPANEL_USER_NAME")); // delete Cpanel users var_dump ($whmClient->accountsManagementInstance()->delete("CPANEL_USER_NAME")); //----------- Services -----------// /** * \Alaa\Awhm\whm\services\Services class contain some service name , You can use it or pass service's Name */ // restart service var_dump ($whmClient->servicesManagementInstance()->restartService(\Alaa\Awhm\whm\services\Services::HTTP)); // Disable Service var_dump ($whmClient->servicesManagementInstance()->disableService(\Alaa\Awhm\whm\services\Services::FTP)); // Enable Service var_dump ($whmClient->servicesManagementInstance()->enableService(\Alaa\Awhm\whm\services\Services::FTP)); // Get Service Config var_dump ($whmClient->servicesManagementInstance()->getServiceConfig(\Alaa\Awhm\whm\services\Services::FTP)); // Get Service Status var_dump ($whmClient->servicesManagementInstance()->getServiceStatus(\Alaa\Awhm\whm\services\Services::FTP)); //------- Mail --------// // Get email accounts of Cpanel user var_dump ($whmClient->mailManagementInstance()->getEmailAccountsOfCpanelUser("CPANEL_USER_NAME"));
Note
If you need any non exists operation , you are welcome to order it .
Contact me on :
Email : elboray.alaa1@gmail.com
whatsapp : +201063745208
License
alaa-hany/awhm is licensed under the MIT License.
alaa-hany/awhm 适用场景与选型建议
alaa-hany/awhm 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 1, 最近一次更新时间为 2022 年 04 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 alaa-hany/awhm 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 alaa-hany/awhm 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-04-02