PHPackages                             dormilich/arin-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. dormilich/arin-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

dormilich/arin-client
=====================

A PHP library to communicate with the ARIN database.

1.1.2(5mo ago)1120[1 issues](https://github.com/Dormilich/arindb-client/issues)LGPL-2.1PHP

Since Dec 18Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/Dormilich/arindb-client)[ Packagist](https://packagist.org/packages/dormilich/arin-client)[ Docs](https://github.com/Dormilich/arin-client)[ RSS](/packages/dormilich-arin-client/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

ArinDB-Client
=============

[](#arindb-client)

A PHP library to communicate with the ARIN database (Reg-RWS).

Setting up data objects
-----------------------

[](#setting-up-data-objects)

There is a multitude of possibilities to set up the data object.

- The XML leaf nodes (e.g. ``) use `setValue()`
- collection elements (such as `` or ``) also support `addValue()`
- all payloads use `set()` and `add()` together with the element name
- payloads and collection elements implement the `ArrayAccess` interface. I.e. you can traverse the XML structure as if it were a multidimensional array (where collections represent numerically indexed and payloads associative arrays). Note that you can only set named leaf nodes’ values via array access (cf. `$net['ASN']` vs. `$net['net']`in the example below).

```
use Dormilich\WebService\ARIN\Elements\Element;
use Dormilich\WebService\ARIN\Payloads\Customer;
use Dormilich\WebService\ARIN\Payloads\Country;
use Dormilich\WebService\ARIN\Payloads\Net;
use Dormilich\WebService\ARIN\Payloads\NetBlock;

$customer = new Customer;

// adding simple values
$customer
  ->set('city', 'MyTown')
  ->set('postalCode', 12345)
;
// set values array style
$customer['city'] = 'AnyTown';

// delete values
unset($customer['city']);

// some elements know what to save
$customer['private'] = 'on';
var_dump($customer['private']->getValue()); // bool(true)
// …even if you use their alias
echo $customer['private']->getName(); // customerPrivate

// set up sub-payloads…
// …partially…
$customer['country']['code2'] = 'US';
// …or at once
$country = new Country;
$country['code3'] = 'USA';
$country['e164'] = 1;       # that’s the country calling code, btw.
$customer['country'] = $country;

// set up multi-line elements’ values…
$customer
  ->add('comment', 'line 1')
  ->add('comment', 'line 2')
;
$customer['comment'][] = 'line 3';
$customer['comment']->addValue('line 4');

// …edit them…
$customer['comment'][3] = 'LINE 4';

// …or delete selected ones
unset($customer['comment'][2]);

// element groups work similar (but you have to know what to put in!)
$net = new Net;
$net['ASN'][0] = Element::createWith('originAS', 'AS-007');

// and of course they are editable
$net['net'][0] = new NetBlock;
$net['net'][0]['start'] = '192.168.10.32';
$net['net'][0]['end']   = '192.168.10.63';
```

These data objects perform some basic validation (you can’t put an object into a field that expects a string and vice versa, some type-related fields allow only predefined values) but generally you have to know what belongs where.

Exceptions are fired for

- invalid value types
- value constraint violations
- accessing non-existent fields

Setting up the web service
--------------------------

[](#setting-up-the-web-service)

For the web service to work, you need a connection object that implements the `ClientAdapter` interface. This can be an existing library or you can write the connectivity functionality yourself (although I recommend the first option).

To configure the web service itself there are four options to set:

- *environment* : either "live" for the prduction database or "test" for the OT&amp;E database.
- *password* : your respective API key for accessing either database.
- *encoding* : the encoding charset for the XML you will send. Defaults to UTF-8.
- *strict* : set this option to FALSE if you want to bypass the pre-serialisation validity check. Defaults to TRUE.

Working with the web service
----------------------------

[](#working-with-the-web-service)

There are two web service objects available: *TicketRWS* for anything that is processed through tickets (tickets, reports, and ROA) and *CommonRWS* that relates to CRUD operations (such as assigning a network to a customer).

```
use Dormilich\WebService\ARIN\WebService\CommonRWS;
use Dormilich\WebService\ARIN\Payloads\Customer;
use Dormilich\WebService\ARIN\Payloads\Net;

$client = new MyClient(…);
$arin = new CommonRWS($client, [
    'environment' => 'live',
    'password'    => 'my-arin-password',
]);

/* set up customer */

$customer = new Customer;

# set up customer object…

// don’t ask me why customers have to be newly created for every net
$customer = $arin->create($customer, 'PARENT-NET-HANDLE');

/* set up net with that customer */

$net = new Net;

# assign network properties, among that…
$net['customer']  = $customer->getHandle();
$net['parentNet'] = 'PARENT-NET-HANDLE';

// don’t ask me why there is a need for a wrapper
$response = $arin->create($net);

// mind that a network assignment will result
// in a ticket if the automated process failed.
try {
    $net = $response['net'];
}
catch (Exception $e) {
    $ticket = $response['ticket'];
}

// alternately fetch the first element
$net = $response[0];

if ($net instanceof Net) {
    # net successfully assigned
}
```

Error handling
--------------

[](#error-handling)

The error handling depends on how your connection object handles HTTP errors. If the Reg-RWS returns an error payload, you can convert that to an object via `Payload::loadXML()` or you use the object you received from the web service call if your connection didn’t throw an exception.

Note
----

[](#note)

All payloads and group elements are iterable and can therefore be used directly in a `foreach()` loop. Additionally, payloads can be serialised into JSON.

All elements can be converted into a string. If there is an XML attribute associated with that element, you can access it as the object’s property.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance53

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1190 days

Total

4

Last Release

152d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/392135?v=4)[Bertold von Dormilich](/maintainers/Dormilich)[@Dormilich](https://github.com/Dormilich)

---

Top Contributors

[![Dormilich](https://avatars.githubusercontent.com/u/392135?v=4)](https://github.com/Dormilich "Dormilich (174 commits)")

---

Tags

composer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dormilich-arin-client/health.svg)

```
[![Health](https://phpackages.com/badges/dormilich-arin-client/health.svg)](https://phpackages.com/packages/dormilich-arin-client)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25025.5M80](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87930.4k113](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M84](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69122.6k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
