Download the PHP package sandwave-io/dns-made-easy without Composer
On this page you can find all versions of the php package sandwave-io/dns-made-easy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sandwave-io/dns-made-easy
More information about sandwave-io/dns-made-easy
Files in sandwave-io/dns-made-easy
Package dns-made-easy
Short Description PHP SDK for the DNS Made Easy API
License MIT
Informations about the package dns-made-easy
DNS Made Easy PHP Client Library
This package is a fork from the original DNSMadeEasy/dme-php-sdk.
This is an API client library for the DNS Made Easy API.
More information about the API may be found in the official API documentation.
- Installation
- Usage
- Examples
Installation
The easiest way to install and use this client library is using Composer. The following command will add the library to your application and install it from Packagist.
Getting Started
You will need a DNS Made Easy account and API credentials. You can get an account at the DNS Made Easy website. There is an API sandbox available, you can create a new account here.
With the package installed through composer, you just need to create the client and set the API key and secret key.
You may now use the client to query the API retrieve objects. Usage is documented in GitHub in the docs directory.
Using the Sandbox
You can tell the client to use the sandbox API endpoint by using the setEndpoint
method:
Putting it all together
Putting this together, it's time for the API equivalent of Hello World. Let's get a list of your domains.
There are more examples further down of using the API client SDK.
Configuration
There are additional configuration options you can use with the client as well as just specifying the sandbox.
Logging
You can specify a logger that implements the PSR-3 Logger specification such as MonoLog. The client is a LoggerAwareInterface
and the logger can be specified either in the constructor or via a method call.
If no logger is specified then a null logger that does nothing will be used.
Custom HTTP Client
If you need additional configuration for HTTP requests in your application, for example to specify a proxy server or if you want to use your own HTTP client matching the PSR-18 HTTP Client specification.
You can specify the client using either the constructor or via a method call.
Examples
Full documentation of the library methods are in the docs folder.
Managers
Managers are used for managing your access to resources on the API, including creating new resources and fetching existing ones from the API. These can be accessed as properties on the client.
Manages are also used to create new objects.
The domain is not saved on the API until you call $domain->save()
.
Multiple objects can be fetched using the paginate()
method on the manager. You can specify the page number and the number of items per page.
Models
The models themselves follow an Active Record pattern. Properties can be updated and save()
called on the model to update the API.
You can delete an object by calling delete()
on it:
Creating a domain and records
This example creates a new domain and adds records to it.
Contributing
When contributing to this project, you can run the following quality checks:
All versions of dns-made-easy with dependencies
php Version ^8.1
ext-mbstring Version *
psr/container Version ^2.0.2
guzzlehttp/psr7 Version ^2.4.4
psr/log Version ^3.0.0
guzzlehttp/guzzle Version ^7.5.0
illuminate/pagination Version ^9.52.7||^10.3.3