PHPackages                             kazami-labs/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. kazami-labs/ripedb-client

ActiveLibrary

kazami-labs/ripedb-client
=========================

A PHP library to communicate with the RIPE NCC database.

1.0.7(7y ago)01.1kLGPL-2.1PHPPHP ^5.4 || 7.0 - 7.2

Since Aug 5Pushed 7y ago4 watchersCompare

[ Source](https://github.com/Kazami-Labs/ripedb-client)[ Packagist](https://packagist.org/packages/kazami-labs/ripedb-client)[ Docs](https://github.com/Kazami-Labs/ripedb-client)[ RSS](/packages/kazami-labs-ripedb-client/feed)WikiDiscussions master Synced 2mo ago

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

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

[](#ripedb-client)

A PHP library to communicate with the RIPE NCC database.

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

[](#requirements)

The RipeDB-Client requires PHP 5.4 up to PHP 7.2. The connection object might have further preconditions.

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

[](#installation)

You can install the RIPE client via composer

```
composer require kazami-labs/ripedb-client

```

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 a HTTP status code of 409 then the used IP range (127.0.0.0/31) already exists in the TEST database and has to be deleted before running the test again.

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 convienient doing this you can use the `Guzzle6Adapter` from the `tests/Test`folder (although you might want to change the namespace). However, be aware that Guzzle 6 requires PHP 5.5 or above.

Usage
-----

[](#usage)

For the web service there are two 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.
- password - for any modifying operation (create/update/delete) you must provide the password for the object’s maintainer. The default password is the one for the TEST database’s primary maintainer.

For more information check out the [RIPE REST API Documentation](https://github.com/RIPE-NCC/whois/wiki/WHOIS-REST-API) and the [RIPE Database Documentation](https://www.ripe.net/manage-ips-and-asns/db/support/documentation/ripe-database-documentation)

### Setting up the web service object

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

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

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

// you can set also these options separately
$ripe   = new WebService($client);
$ripe->setEnvironment(WebService::PRODUCTION);
```

### 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.86

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 92.4% 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 ~135 days

Recently: every ~210 days

Total

8

Last Release

2618d ago

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

1.0.7PHP ^5.4 || 7.0 - 7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7666f14005d0c2cf8793ea5fa75e779cee104ef0447ea333c6e188f4fd19f398?d=identicon)[shirakun](/maintainers/shirakun)

---

Top Contributors

[![Dormilich](https://avatars.githubusercontent.com/u/392135?v=4)](https://github.com/Dormilich "Dormilich (110 commits)")[![shirakun](https://avatars.githubusercontent.com/u/11274807?v=4)](https://github.com/shirakun "shirakun (5 commits)")[![dan-iway](https://avatars.githubusercontent.com/u/19486346?v=4)](https://github.com/dan-iway "dan-iway (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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