piteurstudio/php-nicdz

checks availability of .DZ and whois data via the nic.dz API

v1.0.2 2024-10-22 00:08 UTC

This package is not auto-updated.

Last update: 2024-10-22 00:18:14 UTC


README

image

Latest Version on Packagist Tests Total Downloads wakatime

PHP Client for Nic.dz provides an easy-to-use interface for checking .dz domains through the official nic.dz Public API.

Effortlessly check domain availability or retrieve detailed WHOIS information for .dz domain extensions.

Requirements

  • PHP 8.0 or higher

Installation

Install the package via Composer:

composer require piteurstudio/php-nicdz

Usage

Domain Availability Check

Easily verify if a .dz domain is available:

use PiteurStudio\NicDz;

include 'vendor/autoload.php';

$domainChecker = new NicDz('example-domain.dz');

$isAvailable = $domainChecker->isAvailable(); // Returns boolean: true if available, false otherwise

Note: The package supports valid .dz extensions including: .gov.dz, .org.dz, .com.dz, .net.dz, .edu.dz, .asso.dz, .pol.dz, .art.dz, .soc.dz, .tm.dz .

Retrieving WHOIS Information

Get detailed WHOIS information in various formats:

$domainChecker = new NicDz('piteur-studio.dz');

// As an array
$whoisDataArray = $domainChecker->whois()->toArray();

// As an object
$whoisDataObject = $domainChecker->whois()->toObject();

// As a raw string
$whoisDataString = $domainChecker->whois()->toString();

// As JSON
$whoisDataJson = $domainChecker->whois()->toJson();

Testing

Run the tests with:

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Disclaimer

This package is not officially affiliated with or endorsed by nic.dz. The NIC.dz name, logo, and trademarks are the property of nic.dz.

Credits

License

This package is open-sourced software licensed under the MIT License..