Skip to content

orchestra-io/services-mongohq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Synopsis

This package is used to interact with the MongoHQ provider API. As the API evolves, this package will cover the new methods provided. Currently we can only add and delete databases using the MongoHQ API.

Requirements

  • PHP 5.3.x
  • PECL HTTP

Example

Here are a few methods covered by this API wrapper.

Create new Database

<?php 
    require_once 'Orchestra/Services/Mongohq.php'; 
    use orchestra\services\Mongohq;

    $svc = new Mongohq('XXX', 'YYY');
    $response = $svc->add(array(
        'plan'         => 'free',
        'app_id'       => 'some-application-name',
	'callback_url' => 'https://my.service.com'
    ));

    echo $response->config->MONGOHQ_URL . PHP_EOL;
    echo $response->id;
?>

Delete a previously created database

<?php 
    require_once 'Orchestra/Services/Mongohq.php'; 
    use orchestra\services\Mongohq;

    $svc = new Mongohq('XXX', 'YYY');
    $response = $svc->delete('some-id');

    var_dump($response);
?>

License

This is released under the New BSD license. Should you require a copy of the license, it is included in this very repository.

Copyright

Orchestra Platform Ltd. 2011

Links

About

Orchestra Services MongoHQ API Wrapper

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages