2017 © Pedro Peláez
 

library php-dreamhost

PHP class for the Dreamhost API

image

danielcosta/php-dreamhost

PHP class for the Dreamhost API

  • Tuesday, September 2, 2014
  • by danielcosta
  • Repository
  • 1 Watchers
  • 5 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

PHP class for the Dreamhost API Build Status

Interfaces with the Dreamhost API, (*1)

Installation

Package available on Composer. Autoloading is PSR-0 compatible., (*2)

Usage

<?php

use DanielCosta\Dreamhost;

$dh = new Dreamhost('your api key'[,format]);
$dh->exec('command'[, array(arg => value[, ...])]);

Where 'command' is one of the many listed on the Dreamhost Wiki API article., (*3)

Method 'exec' returns either an array of associative arrays of the data returned by Dreamhost or throws an exception upon error., (*4)

You can define any preferred return format by passing a second argument to class constructor. Defaults to 'json'., (*5)

Example

<?php

use DanielCosta\Dreamhost;

$dh = new Dreamhost('6SHU5P2HLDAYECUM'[,format]);

try {
    $method = 'api-list_accessible_cmds';
    $commands = $dh->exec($method);
    // $commands = $dh->$method(); // this should also work
    print_r($commands);
} catch (Exception $e) {
    echo $e->getMessage(); // contains either the error data returned by dreamhost or a curl error string and number
}

The Versions

02/09 2014

2.0.x-dev

2.0.9999999.9999999-dev

PHP class for the Dreamhost API

  Sources   Download

MIT

The Requires

 

The Development Requires

22/08 2013

dev-master

9999999-dev

PHP class for the Dreamhost API

  Sources   Download

BSD-3-Clause

22/08 2013

1.0.0

1.0.0.0

PHP class for the Dreamhost API

  Sources   Download

BSD-3-Clause