Search by

dapikk / osrs-toolkit-php

DaPikk

Modernized fork of the official OpenSRS PHP Toolkit with PHP 7.4-8.4 compatibility, fixes and improvements

Package info

github.com/DaPikk/osrs-toolkit-php

pkg:composer/dapikk/osrs-toolkit-php

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v5.0.0 2026-09-23 12:44 UTC

This package is auto-updated.

Last update: 2026-09-23 12:52:53 UTC


README

PHP 7.4 PHP 8.0 PHP 8.1 PHP 8.2 PHP 8.3 PHP 8.4 License

A community-maintained fork of the OpenSRS PHP Toolkit with compatibility for PHP 7.4 through PHP 8.4. This project is based on the original OpenSRS toolkit and contains additional compatibility fixes, modernization work, and other improvements intended for use with current PHP environments.

Important

This repository is not an official OpenSRS release.

It is an independently maintained fork based on the official OpenSRS PHP Toolkit.

Features

  • ✅ PHP 8.4 (from 7.4+) support
  • ✅ Tested using GitHub Actions
  • ✅ Composer-based installation
  • ✅ PSR-4 autoloading
  • ✅ OpenSRS Domains API support
  • ✅ JSON and YAML support
  • ✅ Legacy OpenSRS API compatibility
  • ✅ Additional fixes and modernization
  • ✅ MIT licensed

Table of Contents

Requirements

The maintained fork requires a modern PHP environment.

Requirement Status
PHP 8.4 ✅ Required / Tested
Composer ✅ Required
OpenSSL ✅ Required
cURL / ext-curl ✅ Required for OMA
JSON ✅ Included with PHP
OpenSRS reseller account ✅ Required for API access

Check your PHP version:

php -v

Verify required PHP extensions:

php -m | grep -E 'curl|openssl|json'

PHP Compatibility

This fork targets:

PHP >= 7.4 >= 8.0 < 9.0

The corresponding Composer requirement is:

{
    "require": {
        "php": "^7.4 || ^8.0",
    }
}

Compatibility status

PHP Version Status
PHP 8.4 ✅ Tested
PHP 7.4 and newer ⚠️ Tested and supported from PHP 7.4+
PHP 9.x ⚠️ Not yet declared compatible

PHP compatibility is validated through the project's GitHub Actions test workflow.

The original OpenSRS toolkit predates PHP 7.x. PHP 8.4 compatibility applies specifically to this maintained fork.

Installation

Install this fork using Composer:

composer require DaPikk/osrs-toolkit-php

Composer will install the package and generate the required autoloader:

vendor/autoload.php

Replacing the upstream package

This fork declares itself as a replacement for:

opensrs/osrs-toolkit-php

This allows applications depending on the original package to use the maintained fork where appropriate.

Configuration

Create an OpenSRS configuration file using the supplied configuration template.

For example:

config/openSRS_config.php

Configure the file with your OpenSRS reseller credentials and API settings.

Security

Warning

Never commit production API keys, passwords, or reseller credentials to your Git repository.

For production environments, sensitive configuration should preferably be loaded from:

  • environment variables;
  • secrets management;
  • deployment configuration;
  • files stored outside the public web root.

Bootstrapping

Load the Composer autoloader followed by your OpenSRS configuration:

<?php

require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/config/openSRS_config.php';

Composer autoloading is the recommended approach when using this fork.

Usage

A basic OpenSRS request can be performed using the toolkit's Request class.

<?php

require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/config/openSRS_config.php';

try {
    $request = new Request();

    $response = $request->process('array', $data);

    var_dump($response->resultRaw);
} catch (\OpenSRS\Exception $e) {
    echo 'OpenSRS API error: ' . $e->getMessage();
}

The contents of $data depend on the OpenSRS command being executed.

Typical API operations include:

  • domain availability checks;
  • domain registrations;
  • renewals;
  • transfers;
  • nameserver changes;
  • contact updates;
  • domain locking;
  • authorization code management.

Refer to the OpenSRS API documentation for the attributes required by each command.

Example: Domain Lookup

A simple domain lookup request may look like:

<?php

require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/config/openSRS_config.php';

$data = [
    'func' => 'lookupLookupDomain',
    'data' => [
        'domain' => 'example.com',
    ],
];

try {
    $request = new Request();

    $response = $request->process('array', $data);

    var_dump($response->resultRaw);
} catch (\OpenSRS\Exception $e) {
    echo 'OpenSRS API error: ' . $e->getMessage();
}

Legacy API

Backward compatibility with applications using the older OpenSRS toolkit API is retained where possible.

<?php

require_once 'your_root_path/opensrs/openSRS_loader.php';

$data = [
    'func' => 'lookupLookupDomain',
    'data' => [
        'domain' => 'example.com',
    ],
];

$osrsHandler = processOpenSRS('array', $data);

var_dump($osrsHandler);

Note

New integrations should use Composer autoloading and the modern API instead of the legacy loader.

Testing

Install development dependencies:

composer install

Run the test suite:

vendor/bin/phpunit

You can also run Composer's platform checks:

composer check-platform-reqs

GitHub Actions

PHP 8.4 compatibility is continuously checked using GitHub Actions.

The status badge at the top of this README reflects the current CI result:

[![PHP 8.4 Tests](https://github.com/DaPikk/osrs-toolkit-php/actions/workflows/tests.yml/badge.svg)](https://github.com/DaPikk/osrs-toolkit-php/actions/workflows/tests.yml)

This means the PHP compatibility status displayed in the README comes directly from the project's actual test workflow.

OpenSRS Environments

OpenSRS provides separate production and testing environments.

Production

Server: rr-n1-tor.opensrs.net
Port:   55443

Production API access normally requires:

  • an OpenSRS reseller account;
  • a production API key;
  • authorization of the connecting server's IP address.

Horizon Test Environment

Server: horizon.opensrs.net
Port:   55443

The Horizon environment can be used for development and testing without creating real production registrations.

Production and test environments use separate credentials.

Troubleshooting

Check PHP

php -v

Check loaded extensions

php -m

At minimum, verify the availability of:

curl
json
openssl

Check Composer

composer diagnose

and:

composer check-platform-reqs

Check PHP configuration

php --ini

Test OpenSRS connectivity

Production:

openssl s_client -connect rr-n1-tor.opensrs.net:55443

Horizon:

openssl s_client -connect horizon.opensrs.net:55443

If authentication fails, verify:

  • reseller username;
  • API key;
  • production vs. test credentials;
  • authorized server IP addresses;
  • selected OpenSRS environment.

Upstream Project

This project is derived from:

OpenSRS PHP Toolkit

https://github.com/OpenSRS/osrs-toolkit-php

Composer package:

opensrs/osrs-toolkit-php

The original project and its authors remain the source of the underlying OpenSRS PHP Toolkit implementation.

Changes in this fork

This fork focuses on maintaining usability with current PHP versions and includes changes such as:

  • PHP 8.4 compatibility;
  • deprecated PHP behavior fixes;
  • compatibility updates;
  • dependency updates;
  • test-suite modernization;
  • code cleanup;
  • additional bug fixes and maintenance changes.

See the repository's commit history and releases for the complete list of changes.

Fork Maintenance

This repository is maintained independently from OpenSRS.

When reporting a problem, first determine whether it relates to:

This fork

Examples:

  • PHP 8.4 compatibility;
  • fork-specific changes;
  • regressions introduced by modernization;
  • Composer dependency issues;
  • failing tests.

Report these through this repository's issue tracker:

https://github.com/DaPikk/osrs-toolkit-php/issues

OpenSRS API

Examples:

  • reseller authentication;
  • API commands;
  • domain registration behavior;
  • OpenSRS account configuration;
  • registry responses.

These should generally be verified against the official OpenSRS documentation or raised with OpenSRS Support.

Support

Fork support

For bugs related specifically to this maintained version:

https://github.com/DaPikk/osrs-toolkit-php/issues

When reporting a problem, include where relevant:

  • PHP version;
  • package version;
  • operating system;
  • failing API operation;
  • exception message;
  • minimal reproduction example.

Never include:

  • API keys;
  • passwords;
  • reseller credentials;
  • authorization codes;
  • other secrets.

OpenSRS support

For service-side or OpenSRS API connectivity problems, consult the official OpenSRS support resources.

Documentation

OpenSRS

Original Toolkit

This Fork

Project Status

Component Status
Project type Community-maintained fork
Based on OpenSRS PHP Toolkit
PHP requirement ^8.4
PHP 8.4 CI ✅ Enabled
Dependency management Composer
Autoloading PSR-4
License MIT
Official OpenSRS release ❌ No

Credits

This project is based on the original OpenSRS PHP Toolkit developed by OpenSRS / Tucows and its contributors.

Original authors include:

  • Colin Campbell
  • Kris Atkinson

Additional PHP 8.4 compatibility work, maintenance, and improvements are provided by the maintainers of this fork.

License

This project is distributed under the MIT License.

See LICENSE for details.

OpenSRS PHP Toolkit — PHP 8.4 Fork
Community-maintained for modern PHP environments.