2017 © Pedro Peláez
 

library loopia-api

Simple interface for the Loopia XMLRPC-API

image

olssonm/loopia-api

Simple interface for the Loopia XMLRPC-API

  • Thursday, June 7, 2018
  • by olssonm
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Loopia API

A super simple wrapper for the Loopia XML RPC-API for PHP., (*1)

Relies on lstrojny/fxmlrpc to make fast and efficient calls to the API. Requires PHP ^7.2 or PHP ^8.0., (*2)

Installation

``` bash $ composer require olssonm/loopia-api, (*3)


## Usage Using the package is straight forward – just include the client, create an instance and make your calls. All methods are listed over at the [Loopia API-documentation](https://www.loopia.se/api/). **Get all your domains** ``` php use Olssonm\LoopiaApi\Client; $response = (new Client('username', 'password')) ->getDomains() ->getResponse();

If needed, you may of course separate your code, like so:, (*4)

``` php use Olssonm\LoopiaApi\Client;, (*5)

$client = new Client('username', 'password');
$client->getDomains();
$response = $client->getResponse();

**Check the zone records for a domain (with subdomain)** ``` php use Olssonm\LoopiaApi\Client; $response = (new Client('username', 'password')) ->getZoneRecords('example.com', '@') ->getResponse();

Update your DNS (name)-servers, (*6)

``` php use Olssonm\LoopiaApi\Client;, (*7)

$response = (new Client('username', 'password'))
    ->updateDNSServers('example.com', ['ns1.loopia.se', 'ns2.loopia.se'])
    ->getResponse();

**Update your zone records** ``` php use Olssonm\LoopiaApi\Client; $response = (new Client('username', 'password')) ->updateZoneRecord('example.com', '@', [ 'type' => 'A', 'ttl' => '3600', 'priority' => 10, 'rdata' => '74.125.0.0', 'record_id' => 0 ]) ->getResponse();

Testing

Copy /tests/boot.example.php to /tests/boot.php and edit your settings. Then run:, (*8)

bash vendor/bin/phpunit --bootstrap ./tests/boot.php ./tests/LoopiaApiTests.php, (*9)

Of course the domain under testing needs to be owned by your Loopia account. Note: The last test (test_update_name_servers) actually modifies your name servers, use with caution., (*10)

License

The MIT License (MIT). Please see License File for more information., (*11)

© 2021 Marcus Olsson., (*12)

The Versions

07/06 2018

dev-master

9999999-dev https://github.com/olssonm/loopia-api

Simple interface for the Loopia XMLRPC-API

  Sources   Download

MIT

The Requires

 

The Development Requires

xml-rpc olssonm loopia

07/06 2018

v1.0

1.0.0.0 https://github.com/olssonm/loopia-api

Simple interface for the Loopia XMLRPC-API

  Sources   Download

MIT

The Requires

 

The Development Requires

xml-rpc olssonm loopia