Skip to content

cristiberceanu/truevault-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TrueVault PHP Client Library

This is unofficial TrueVault PHP client library that enables developers to implement a rich set of server-side functionality for accessing TrueVault's API.

Requirements

  • PHP 5
  • Curl PHP extension
  • Json PHP extension

Examples

require_once("lib/truevault.php");

define("TRUEVAULT_VAULT_ID", "12345678-1234-1234-1234-123456789012");
define("TRUEVAULT_API_KEY", "12345678-1234-1234-1234-123456789012");
define("TRUEVAULT_ACCOUNT_ID", "12345678-1234-1234-1234-123456789012");

$trueVault = new TrueVault(array(
    "apiKey" => TRUEVAULT_API_KEY,
    "accountId" => TRUEVAULT_ACCOUNT_ID
));

// get all vaults
// $trueVault->findAllVaults();

$schemas = $trueVault->schemas(TRUEVAULT_VAULT_ID);
$documents = $trueVault->documents(TRUEVAULT_VAULT_ID);

Document methods

$response = $documents->create(array("name" => "Don Joe"));
$documentId = $response["document_id"];

$documents->get($documentId);
$documents->update($documentId, array("name" => "Don John"));
$documents->delete($documentId);
$documents->search(array("page" => 1, "per_page"=> 3,"filter" => array("name" => array("type" => "not", "value" => "Susan"));

Schema methods

$schema = $schemas->create(array("name" => "name", "fields" => array(array("name" => "name", "index" => true, "type" => "string"))));
$schemaId = $schema["id"];

$schemas->get($schemaId);
$schemas->update($schemaId, array("name" => "user", "fields" => array(array("name" => "name", "index" => true, "type" => "string"))));
$schemas->get($schemaId);
$schemas->findAll();
$schemas->delete($schemaId);

Resources

TrueVault REST API Documentation

TODO

  • Add BLOB support

Author

License

About

TrueVault PHP client library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages