bingemer/inwxbundle

A Symfony bundle to use the inwx api (Domrobot class https://github.com/inwx/php-client)

Installs: 24

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

dev-master / 1.1.x-dev 2016-08-21 21:48 UTC

This package is not auto-updated.

Last update: 2024-12-17 23:13:49 UTC


README

Build Status: Build Status Scrutinizer Code Quality

Features

  • Uses the inwx class: https://github.com/inwx/php-client
  • Service that performs api login upon __construct(), logout on __destruct()
  • predefined funtions for common steps like new DNS entry or update an existing entry.

Installation

Add the package to your composer.json file

"bingemer/inwxbundle": "dev-master",

Add this to app/AppKernel.php

<?php
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Bingemer\InwxBundle\BingemerInwxBundle(),
        );

        ...

        return $bundles;
    }

Configuration

1) Edit app/config.yml

Add the following parameters to parameters.yml

parameters:
    ...
    inwx_user: username
    inwx_pass: password
    inwx_url: 'https://api.domrobot.com/xmlrpc/'
    inwx_locale: en

Usage

In your Controller get the service:

$domrobot = $this->get('bingemer_inwx_bundle');

Use the functions provided to create an A entry (4th parameter is entry type which defaults to 'A'):

$result = $domrobot->createRecord('hostname w/o domain', 'ip-address', 'domain');

update record:

$result = $domrobot->updateRecord('inwx_id, 'ip-address');

delete record:

$result = $domrobot->deleteRecord('inwx_id);

The result array is 1:1 from the original Domrobot class documented here: API DOC

In case of my createRecord() function, the "inwx_id" is contained in the $result.

The original Domrobot class can be found here: Inwx Domrobot Class

More information and classes for other languages can be found here: https://www.inwx.de/en/offer/api

Errors

This is my first symfony bundle, if you have any problems or found mistakes I made please tell me ;)