Download the PHP package vivaserver/nic_ar without Composer

On this page you can find all versions of the php package vivaserver/nic_ar. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nic_ar

NicAr\Client

The NicAr\Client Composer package allows to you programatically extract information about any ".ar" (Argentina) domain name. This package is also the official PHP client for the public nic!alert API.

Installation

The easiest way is to install it as any Composer package. Just add an entry to your composer.json file requiring the latest available version:

...
"require": {
  "vivaserver/nic_ar": "dev-master"
  ...
}
...

The package will be automatically installed when you execute the composer install command.

Installation without Composer

If for some reason you want to install the NicAr\Client without the Composer package manager, there are two relevant files you need:

  1. Agent.php
  2. Client.php

Having both files on the PHP include path, you can require both on that order before creating an instance of the client:

require 'Agent.php';
require 'Client.php';
$client = new NicAr\Client;

Usage

Create a new instance of the NicAr\Client after requiring the Composer autoloader and you should be ready to go.

require 'vendor/autoload.php';
$client = new NicAr\Client;

The NicAr\Client class constructor has two initialization options, both optional:

  1. The first is a string that can be set to an API token to by-pass the CAPTCHA challenge that the NIC.ar website sometimes requests you to solve before answering your domain lookup. Please refer to the nic!alert API official documentation for more details.

    $client = new NicAr\Client("234d3cdf979e04db3d709ed8");
  2. The second is a boolean option for setting the responses to objects or associative arrays formats. By default the responses will be returned in an object format, just like the json_decode function would. To set it to an associative array format, pass the TRUE argument:

    $client = new NicAr\Client(NULL, TRUE);

All the following usage examples will consider responses with an associative array format.

Domain lookups

The NicAr\Client supports lookups for domain names. First, find out what kind of domain names you are allowed to lookup.

$domains = $client->whois();

A typical response would be:

Array
(
  [0] => .com.ar
  [1] => .gov.ar
  [2] => .int.ar
  [3] => .mil.ar
  [4] => .net.ar
  [5] => .org.ar
  [6] => .tur.ar
)

All the following lookups will raise a NicAr\NotFound exception if the requested resource could not be found.

$domains = $client->whois("vivaserver.com.ar");

The response for an existing, registered, delegated domain would be like this:

Array
(
  [status] => Array
    (
      [available] => 
      [delegated] => 1
      [expiring] => 
      [phasing_out] => 
      [pending] => 
      [registered] => 1
    )
  [name] => vivaserver.com.ar
  [created_on] => 2004-11-18
  [expires_on] => 2014-11-18
  [message] => 
  [contacts] => Array
    (
      [registrant] => Array
        (
          [name] => Cristian Renato Arroyo
          [occupation] => Diseno de Paginas Web
          [address] => Pje. Vucetich 676. Ciudad De Nieva
          [city] => S. S. de Jujuy
          [province] => Jujuy
          [zip_code] => 4600
          [country] => Argentina
          [phone] => (0388)155827713
          [fax] => (0388)155827713
        )
      [responsible] => 
      [administrative] => 
      [technical] => 
    )
  [name_servers] => Array
    (
      [primary] => Array
        (
          [host] => ns1.mydyndns.org
          [ip] => 
        )
      [secondary] => Array
        (
          [host] => ns2.mydyndns.org
          [ip] => 
        )
      [alternate1] => Array
        (
          [host] => ns3.mydyndns.org
          [ip] => 
        )
      [alternate2] => Array
        (
          [host] => ns4.mydyndns.org
          [ip] => 
        )
      [alternate3] => Array
        (
          [host] => ns5.mydyndns.org
          [ip] => 
        )
    )
)

Check a domain status

You can also check if a given domain name resolves OK to it's name servers, thus effectively know if it's available online or not.

$client->status("www.nic.ar");

A successful response would be like:

Array
(
  [status] => Array
    (
      [domain] => www.nic.ar
      [online] => 1
      [offline] => 
      [ip] => 200.16.109.25
      [host] => roldan.nic.ar
    )
)

But also note that a domain name without the "www." may or may not resolve in the same way.

$client->status("nic.ar");

A successful response would be like:

Array
(
  [status] => Array
    (
      [domain] => nic.ar
      [online] => 1
      [offline] => 
      [ip] => 200.16.109.19
      [host] => firpo.nic.ar
    )
)

Full API reference

The full documentation of the public nic!alert API is available at http://api.nicalert.me/docs if you want to write your own client, use any other language, or just use CURL in a RESTful way.

License

This software is released under the MIT License.

Copyright

©2014 Cristian R. Arroyo


All versions of nic_ar with dependencies

PHP Build Version
Package Version
Requires vivaserver/restful_agent Version dev-master
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vivaserver/nic_ar contains the following files

Loading the files please wait ....