Download the PHP package tafhyseni/godaddy-php without Composer

On this page you can find all versions of the php package tafhyseni/godaddy-php. 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 godaddy-php

GoDaddy PHP 🐘

A minimalist Godaddy PHP package for most of your operations with GoDaddy API..\ PHP version Build Status StyleCI

System Requirements

You need:

Installation

composer require tafhyseni/godaddy-php;

Usage

Before using GoDaddy PHP make sure you have already created a developer account at Godaddy Developer Portal.

Since this package uses php-domain-parser for validations and interactions with domain, make sure you enable ext-intl extension in your php.ini configuration.

use Tafhyseni\PhpGodaddy\Domain;
Domain::initialize('YOUR_API_KEY', 'YOUR_SECRET_KEY', 'PRODUCTION_MODE');

Methods

Check Domain Availability

Returns domain availability status, price to string, currency and period.

An example checking domain availability is as simple as it follows

try {
    $domain = Domain::initialize('YOUR_API_KEY', 'YOUR_SECRET_KEY', 'PRODUCTION_MODE');
    $mydomain = 'testingdomain.com';

    $check = $domain->available($domain);

    if($check->isAvailable())
    {
        // Domain is available
        $domainPrice = $this->priceToString();
    }else{
        // Domain is not available
    }
}

Available response properties and methods

Parameter / Method Data type Description
isAvailable() bool Returns domain availability status
priceToString() string Returns a response message containing: { price } { currency } / { period } year(s)
domain string Requested domain
availability integer Availability status
price float Domain price
currency string Currency in which price is listed
period integer Domain availability period

Multiple Domain Checks

A multiple availability check is covered aswell

$domain->availableMultiple([]);

Domain Suggestion

Returns a list of suggestions based in the keyword you specify.


$domain = Domain::initialize('YOUR_API_KEY', 'YOUR_SECRET_KEY', 'PRODUCTION_MODE');

$keyword = 'mybestdomain';

$suggestion = $domain->suggestion($keyword, 'LIMIT');


| Request parameters | Data type | Default |
| ------------------ | --------- | ------- |
| keyword            | string    | -       |
| limit              | integer   | 97      |

| Response parameters | Description               |
| ------------------- | ------------------------- |
| keyword             | Requested keyword         |
| limit               | Requested limit           |
| domains             | Array of returned domains |

#### Domain Purchase
> Purchase domain from Godaddy. First, set payment method for your account in Godaddy developer portal.
~~~php
$domainName = 'mypurchasedomain.com';
$domain = Domain::initialize('YOUR_API_KEY', 'YOUR_SECRET_KEY', 'PRODUCTION_MODE');

$options = [
    'name'         => 'John',
    'surname'      => 'Doe',
    'email'        => '[email protected]',
    'phone'        => '+48.111111111',
    'organization' => 'Corporation Inc.',
    'street'       => 'Street Ave. 666',
    'city'         => 'New York City',
    'country'      => 'US',
    'postalCode'  => '91111',
    'state'        => 'New York'
];

try {
    $purchase = $domain->purchase($domainName, $options)
        ->nameServers([
            'dns.nameserver.com',
            'dns2.nameserver.com'
        ])->submit();
}catch(Exception $e) {
    // Catch Exception
}
Request parameters Data type Default
domain string -
options array -
nameServers() array -
period() integer 1
autorenew() bool true
Response paramters Data type Description
currency string Currency in which total is listed
itemCount integer Number of items included in the order
orderId integer Unique identifier of the order processed
total integer Total cost of the domain and any selection addons in micro unit

Changing DNS Records

$domainName = 'testinjoooo.biz'; // An already registered domain name under your account
$domain = Domain::initialize('YOUR_API_KEY', 'YOUR_SECRET_KEY', 'PRODUCTION_MODE');

$domain->records($domainName, 'RECORD_TYPE', [
    ['name' => 'Point', 'data' => '123.1.1.1'],
    ['name' => 'Point2', 'data' => '123.1.1.3'],
])->set();

Default API Return object

A general API response object is already declared and returns the following properties property data type description
httpStatus integer Http response code
httpHeaders array Http headers
httpBody Object Method properties
httpMessage string Any available http message

Exceptions

We created custom responses which should be catched from your side. Therefor, using try/catch blocks is highly recommended.

Common Exception thrown

Code Name Message
401 noApiKeyProvided API Key has not been provided!
401 noSecretKeyProvided Secret Key has not been provided!
401 authorizationFailed Authorization failed. Check your secret/api keys.
400 noDomainProvided Domain name is required and cannot be empty!
422 noKeywordProvided No keyword has been specified!
400 invalidDomainPeriod Domain period should be within 1 and 10 range
404 domainNotAvailable Domain is not available for registration
403 invalidPaymentInfo Invalid payment information provided at your API account!
400 invalidRecordType Record type is invalid. Available types are: A, AAA, CNAME, MX, NS, SRV, TXT
404 recordDomainNotFound Given domain has not been found or is not registered

All versions of godaddy-php with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2.5|^8.0
ext-intl Version *
guzzlehttp/guzzle Version >=6.5
jeremykendall/php-domain-parser Version ^5.6
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 tafhyseni/godaddy-php contains the following files

Loading the files please wait ....