nexylan/gandi-sdk

用于与Gandi API通信的PHP SDK

v0.7.0 2024-03-08 10:25 UTC

This package is auto-updated.

Last update: 2024-09-08 11:25:46 UTC


README

Gandi API PHP SDK.

Latest Stable Version Latest Unstable Version License

Total Downloads Monthly Downloads Daily Downloads

文档

所有安装和使用说明都位于本README文件中。请检查特定版本。

安装

首先,您需要通过Composer引入此库

composer require nexylan/gandi-sdk

使用Symfony

AppKernel类中启用该捆绑包

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Nexy\Gandi\Bridge\Symfony\Bundle\NexyGandiBundle(),
    );

    // ...

    return $bundles
}

配置

根据您的需求配置捆绑包

# parameters.yml
parameters:
    # Change to https://rpc.gandi.net/xmlrpc/ in prod
    gandi_api_url: https://rpc.ote.gandi.net/xmlrpc/
# config.yml
nexy_gandi:
    api_url: %gandi_api_url%
    api_key: 'yourApiKey'

使用

使用预定义的方法或直接使用Gandi方法

$gandi = new Gandi('api_url', 'api_key');

$result = $gandi->setup()->domain->info('mydomain.net');

// Results
// [
//     status => [
//         0 => clientTransferProhibited
//     ]
//     zone_id => 42
//     fqdn => mydomain.net
//     // ...
// ]