PHPackages                             dormilich/ripedb-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/ripedb-client

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

dormilich/ripedb-client
=======================

A PHP library to communicate with the RIPE NCC database.

1.1.6(9mo ago)52.4k11LGPL-2.1PHPPHP ^7.0CI failing

Since Aug 5Pushed 9mo ago3 watchersCompare

[ Source](https://github.com/Dormilich/ripedb-client)[ Packagist](https://packagist.org/packages/dormilich/ripedb-client)[ Docs](https://github.com/Dormilich/ripedb-client)[ RSS](/packages/dormilich-ripedb-client/feed)WikiDiscussions master Synced 1mo ago

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

RipeDB-Client
=============

[](#ripedb-client)

A PHP library to communicate with the RIPE NCC database.

Requirements
------------

[](#requirements)

The RipeDB-Client requires PHP 7.0 up to PHP 7.4. The connection object might have further preconditions.

Installation
------------

[](#installation)

You can install the RIPE client via composer

```
composer require dormilich/ripedb-client:^1.1

```

or by cloning this repository.

### Tests

[](#tests)

To run the offline tests run:

```
phpunit

```

on the command line from the project’s root directory.

There is also an online test you can run if you have an internet connection, which runs some basic operations on the RIPE TEST database.

```
phpunit --group live

```

Should these tests fail with an HTTP status code of 409 then the used IP range (127.0.0.0/24) is already occupied otherwise and needs to be cleaned up first. You may also have to disable PHPUnit’s error conversion.

Setup
-----

[](#setup)

In order to create the HTTP connection with the RIPE REST Service you need to create a connection object that implements the `ClientAdapter` interface. Depending on your PHP version, or your own preference you can use any existing library or write one using PHP’s curl or socket functions.

If you’re not convenient doing this you can use the `Guzzle6Adapter` from the `tests/Test`folder (although you might want to change the namespace).

Usage
-----

[](#usage)

For the web service there are four options you can set before using it:

- `environment` - whether to connect to the RIPE (`WebService::PRODUCTION`) or TEST (`WebService::SANDBOX`) database. Per default, it connects to the TEST database. You may set any other name for local testing.
- `username` - the username part of the API key.
- `password` - for any modifying operation (create/update/delete) you must provide the password part of the API key.
- `location` - for local testing any URL that connects to the mock instance. The production/sandbox environments will set their appropriate location automatically.

For more information check out the [RIPE Database Documentation](https://docs.db.ripe.net).

### Setting up the web service object

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

#### Starting from 2026

[](#starting-from-2026)

Since MD5-based password are retired starting from 2026, you need to use one of the API key that you can create in your RIPE account.

```
// create the connection object
$client = new Client(…);

// create the web service object
$ripe   = new WebService($client, [
	'environment' => WebService::PRODUCTION,
	'username'    => 'your API username',
	'password'    => 'your API password',
]);

// you can set also these options separately
$ripe   = new WebService($client);
$ripe->setEnvironment(WebService::PRODUCTION);
$ripe->setUsername('your API username');
$ripe->setPassword('your API password');

// or using a URL
$ripe   = new WebService($client);
$ripe->setHost('https://username:password@rest.db.ripe.net/ripe');
```

#### Before 2026

[](#before-2026)

As long as passwords are supported, they can be used in conjunction with the maintainer handle. If that is not given explicitly, it will be taken from the object that is processed (lookup queries do not require authentication).

```
// create the connection object
$client = new Client(…);

// create the web service object
$ripe   = new WebService($client, [
	'environment' => WebService::PRODUCTION,
	'username'    => 'TEST-MNT', // optional
	'password'    => 'your maintainer password',
]);
```

### Create a RIPE DB entry

[](#create-a-ripe-db-entry)

```
try {
	// create a RIPE object
	$me = new Person;

	// setting attributes via array style
	$me['person'] = 'John Doe';

	// setting multiple-valued attributes via array style
	$me['phone']  = [
		'+1 234 56789',
		'+1 432 98765',
	];

	// setting attributes via method
	$me
		->addAttribute('address', 'Any Street 1')
		->addAttribute('address', 'Anytown')
	;

	// create object in DB
	$me = $ripe->create($me);

	// display result
	echo '', $me, '';
}
catch (RPSLException $e) {
	// errors regarding the setup of the RIPE object
}
// using Guzzle 6 exceptions as example,
// your client implementation may use different exceptions
catch (BadResponseException $e) {
	$errors = WebService::getErrors($e->getResponse()->getBody()));
}
```

Note: the webservice will set the *source* attribute depending on its setting, so you don’t need to set it yourself except when you want to use the serializer or the `isValid()` method before that.

### Update a RIPE DB entry

[](#update-a-ripe-db-entry)

```
try {
	// create a RIPE object with the object’s primary key
	$jd = new Person('JD123-RIPE');

	// fetch the object from the DB
	$jd = $ripe->read($jd);

	// modify the object
	$jd['e-mail'] = 'john.doe@example.com';

	// save the changes
	$jd = $ripe->update($jd);
}
catch (RPSLException $e) {
	// errors regarding the setup of the RIPE object
}
catch (BadResponseException $e) {
	$errors = WebService::getErrors($e->getResponse()->getBody()));
}
```

Note: each RIPE object contains at least the *created* and *last-modified* generated attributes. The latter of them is (obviously) only actual after the update therefore *update()* returns the latest object instance.

### RIPE references

[](#ripe-references)

Some attributes contain references to other RIPE objects (e.g. *tech-c*, *admin-c*, *mnt-\**). When you fetch an object from the RIPE database, for these attributes a special value object (`AttributeValue`) is created that can provide you the type and lookup object (an object with the primary key set to be used in the `read()` method) of the referenced object.

### RIPE comments

[](#ripe-comments)

The RIPE DB uses the hash sign (`#`) for denoting comments. When fetching an attribute with comments, these are transmitted separately from the attribute value. For these case the `AttributeValue` object will be used as well. When accessing the attribute value as string, the comment will be appended.

Notes
-----

[](#notes)

Object validation uses RIPE DB version 1.112.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance58

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 97.1% 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 ~253 days

Total

14

Last Release

277d ago

PHP version history (2 changes)1.0.6PHP ^5.4 || 7.0 - 7.1

1.1.0PHP ^7.0

### 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 (136 commits)")[![dan-iway](https://avatars.githubusercontent.com/u/19486346?v=4)](https://github.com/dan-iway "dan-iway (4 commits)")

---

Tags

composer

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M318](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M292](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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