bastianleicht/hosterapi-php

HosterAPI 的完整功能实现

dev-main 2022-03-28 09:55 UTC

This package is auto-updated.

Last update: 2024-09-28 15:34:17 UTC


README

这个 PHP 7.2+ 库允许你与 HosterAPI 进行通信。

Latest Stable Version Total Downloads Latest Unstable Version License

你可以在这里找到完整的 API 文档!点此访问

入门指南

推荐使用 Composer 进行安装!

在项目根目录中执行以下命令

$ composer require bastianleicht/hosterapi-php

或者将其添加到你的 composer.json 文件中

{
    "require": {
        "bastianleicht/hosterapi-php": "^1.0"
    }
}

然后执行安装

$ composer install --no-dev

示例

创建 HosterAPI 主对象

<?php
// Require the autoloader
require_once 'vendor/autoload.php';

// Use the library namespace
use HosterAPI\HosterAPI;

// Then simply pass your API-Token when creating the API client object.
$client = new HosterAPI('API-Token');

// Then you are able to perform a request
var_dump($client->virtualServer()->list());
?>

如果你想要了解更多关于如何使用这个 PHP-API 的信息,你应该查看 Wiki