metamolecular / chemcaster-php
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
LICENSE | ||
| |
README.rdoc | ||
| |
lib/ | ||
| |
tests/ |
README.rdoc
Chemcaster PHP API
This is the PHP interface for the Chemcaster RESTful Web API. It consists of basic functionality needed to create applications using chemical structure registration, storage, imaging, and search.
Example Use
Connecting to the Service
require_once '/path/to/chemcaster-php/lib/chemcaster.php';
$service = Chemcaster_Service::connect('username', 'password');
Loading a Registry
require_once '/path/to/chemcaster-php/lib/chemcaster.php';
$service = Chemcaster_Service::connect('username', 'password');
$registries = $service->registries;
$size = $registries->size();
$registry = $registries[0];
Creating a Registry
require_once '/path/to/chemcaster-php/lib/chemcaster.php';
$service = Chemcaster_Service::connect('username', 'password');
$registries = $service->registries;
try {
$new_registry = $registries->create( array( 'name' => 'CarboBlocks, Inc.', 'deletable' => FALSE ) );
} catch (Chemcaster_CreationException $e ) {
//...handle exception
//echo $e->getMessage();
//echo $e->http_error_code;
//print_r( $e->http_errors );
}

