Skip to content

Commit 4dc95a7

Browse files
committed
Update for composer
1 parent ecbaf4e commit 4dc95a7

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

client_example.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
2-
// client_example.php
2+
require_once 'vendor/autoload.php';
33

4-
require 'Bind9ApiClient.php';
4+
use Namingo\Bind9Api\ApiClient;
55

66
try {
77
// Initialize the client with the API server's base URL
8-
$apiClient = new Bind9ApiClient('http://localhost:7650');
8+
$apiClient = new ApiClient('http://localhost:7650');
99

1010
// Authenticate and obtain a token
1111
$apiClient->login('admin', 'password123');

composer.json

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
{
2+
"name": "namingo/bind9-api-client",
3+
"description": "The bind9-api-client is a PHP client library designed to interact with the bind9-api-server.",
4+
"type": "library",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Namingo Team",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"autoload": {
13+
"psr-4": {
14+
"Namingo\\Bind9Api\\": "src/"
15+
}
16+
},
217
"require": {
3-
"guzzlehttp/guzzle": "^7.9"
18+
"php": ">=8.2",
19+
"ext-swoole": "*",
20+
"guzzlehttp/guzzle": "^7.9"
421
}
5-
}
22+
}

Bind9ApiClient.php renamed to src/ApiClient.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
<?php
2-
// Bind9ApiClient.php
32

4-
require 'vendor/autoload.php';
3+
namespace Namingo\Bind9Api;
54

65
use GuzzleHttp\Client;
76
use GuzzleHttp\Exception\RequestException;
87

9-
class Bind9ApiClient
8+
class ApiClient
109
{
1110
private $client;
1211
private $baseUrl;

0 commit comments

Comments
 (0)