\Beatnik_Driver_pdnsgsql

The Beatnik_Driver_sql class implements a SQL driver for managing DNS records in the PowerDNS generic SQL driver. The PowerDNS generic SQL driver aims to support MySQL, PostgreSQL, SQLite and Oracle. This driver attempts to do the same as long as the default queries are used.

Copyright 2008-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

Summary

Methods
Properties
Constants
Beatnik_Driver()
getRecDriverTypes()
getRecDriverFields()
getDomains()
getDomain()
getRecord()
recordExists()
saveRecord()
deleteRecord()
factory()
__construct()
_getDomains()
getRecords()
_saveRecord()
_deleteRecord()
_connect()
_disconnect()
$_params
$_db
$_write_db
$_connected
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$_params

$_params : array

Hash containing connection parameters.

Type

array

$_db

$_db : \DB

Handle for the current database connection.

Type

\DB

$_write_db

$_write_db : \DB

Handle for the current database connection, used for writing. Defaults to the same handle as $_db if a separate write database is not required.

Type

\DB

$_connected

$_connected : boolean

Boolean indicating whether or not we're connected to the SQL server.

Type

boolean

Methods

Beatnik_Driver()

Beatnik_Driver(  $params = array()) 

Parameters

$params

getRecDriverTypes()

getRecDriverTypes() : array

Get any record types available specifically in this driver.

Returns

array —

Records available only to this driver

getRecDriverFields()

getRecDriverFields(string  $type) : array

Get any fields available specifically in this driver by record type.

Parameters

string $type

Record type for which fields should be returned

Returns

array —

Fields specific to this driver

getDomains()

getDomains(integer  $perms = \Horde_Perms::SHOW) : array

Gets domains from driver for which the user has the specified permission.

Parameters

integer $perms

Permissions filter for domain result set

Returns

array —

Possibly empty array of domain information

getDomain()

getDomain(  $domainname) : array

Return SOA for a single domain

Parameters

$domainname

Returns

array —

Domain SOA

getRecord()

getRecord(  $id) : array

Gets a specific record from the backend. This method may be overridden in specific backend drivers if there is a performance or other benefit for doing so.

Parameters

$id

Returns

array —

Array of type and record information

recordExists()

recordExists(array  $record,   $rectype) : boolean

Try to determinate if the autogenerated record already exits. This method may be overridden in the backend driver for performance or other reasons.

Parameters

array $record

record to check

$rectype

Returns

boolean —

if records exits or or not

saveRecord()

saveRecord(array  $info) : mixed

Saves a record fo the configured driver and checks/sets needCommit() Also first checks to ensure permission to save record is available.

Parameters

array $info

Data to be passed to backend driver for storage

Returns

mixed —

True on success, PEAR::Error on error

deleteRecord()

deleteRecord(array  $info) : boolean

Delete record from backend

Parameters

array $info

Reference to array of record information for deletion

Returns

boolean —

true on success

factory()

factory(string  $driver = null, array  $params = null) : mixed

Attempts to return a concrete Beatnik_Driver instance based on $driver.

Parameters

string $driver

The type of the concrete Beatnik_Driver subclass to return. The class name is based on the storage driver ($driver). The code is dynamically included.

array $params

(optional) A hash containing any additional configuration or connection parameters a subclass might need.

Returns

mixed —

The newly created concrete Beatnik_Driver instance, or false on an error.

__construct()

__construct(array  $params = array()) 

Constructs a new Beatnik DB driver object.

Parameters

array $params

A hash containing connection parameters.

_getDomains()

_getDomains() : array

Gets all zones

Returns

array —

Array with zone records numerically indexed

getRecords()

getRecords(string  $domain) : array

Gets all records associated with the given zone

Parameters

string $domain

Retrieve records for this domain

Returns

array —

Array with zone records

_saveRecord()

_saveRecord(array  $info) : boolean

Saves a new or edited record to the DNS backend

Parameters

array $info

Array of record data

Returns

boolean —

true on success

_deleteRecord()

_deleteRecord(array  $data) : boolean

Delete record from backend

Parameters

array $data

Reference to array of record data to be deleted

Returns

boolean —

true on success, PEAR::Error on error

_connect()

_connect() : boolean

Attempts to open a persistent connection to the SQL server.

Returns

boolean —

True on success.

_disconnect()

_disconnect() : boolean

Disconnects from the SQL server and cleans up the connection.

Returns

boolean —

True on success, false on failure.