Pterodactyl WHMCS 模块使用教程
whmcsWHMCS Module for Pterodactyl (v0.7.3 and higher)项目地址:https://gitcode.com/gh_mirrors/wh/whmcs
1. 项目的目录结构及介绍
Pterodactyl WHMCS 模块的目录结构如下:
/pterodactyl-whmcs/
├── assets/
│ ├── css/
│ ├── js/
│ └── images/
├── config/
│ └── config.php
├── lang/
│ └── en.php
├── modules/
│ └── servers/
│ └── pterodactyl/
│ ├── callbacks/
│ ├── hooks/
│ ├── templates/
│ └── pterodactyl.php
├── templates/
│ └── default/
│ └── pterodactyl/
├── README.md
└── init.php
目录介绍
assets/
: 包含模块所需的CSS、JavaScript和图像文件。config/
: 包含模块的配置文件。lang/
: 包含语言文件,目前只支持英文。modules/servers/pterodactyl/
: 包含Pterodactyl模块的核心文件。callbacks/
: 包含回调函数文件。hooks/
: 包含钩子文件。templates/
: 包含模板文件。pterodactyl.php
: 模块的主文件。
templates/default/pterodactyl/
: 包含默认的模板文件。README.md
: 项目的说明文件。init.php
: 项目的初始化文件。
2. 项目的启动文件介绍
项目的启动文件是 init.php
。这个文件负责初始化模块,并包含一些必要的配置和函数。
<?php
// init.php
if (!defined("WHMCS")) {
die("This file cannot be accessed directly");
}
require_once __DIR__ . '/modules/servers/pterodactyl/pterodactyl.php';
启动文件介绍
init.php
: 检查是否在WHMCS环境中运行,并加载模块的主文件pterodactyl.php
。
3. 项目的配置文件介绍
项目的配置文件位于 config/config.php
。这个文件包含了模块的所有配置选项。
<?php
// config.php
return [
'api_key' => '',
'api_url' => '',
'default_location' => '',
'default_egg' => '',
'default_nest' => '',
];
配置文件介绍
api_key
: Pterodactyl API 的密钥。api_url
: Pterodactyl API 的URL。default_location
: 默认的服务器位置。default_egg
: 默认的Egg ID。default_nest
: 默认的Nest ID。
以上是Pterodactyl WHMCS 模块的基本使用教程,希望对你有所帮助。
whmcsWHMCS Module for Pterodactyl (v0.7.3 and higher)项目地址:https://gitcode.com/gh_mirrors/wh/whmcs