2017 © Pedro Peláez
 

library stackable-php

Official Stackable library for PHP

image

get-stackable/stackable-php

Official Stackable library for PHP

  • Monday, March 21, 2016
  • by perminder-klair
  • Repository
  • 2 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Stackable PHP Library

This is the Official Stackable API PHP library for getting data from stacks., (*1)

Getting started

Install using Composer, (*2)

$ composer install get-stackable/stackable-php

Or simple include src/Stackable.php file to your project., (*3)

Usage

Make sure to create an account at http://www.stackable.space and setup your Stack and Containers., (*4)

To initialize, (*5)

$stackable = new Stackable('YOUR-STACK-PUBLIC-KEY-HERE');

To list all containers, (*6)

$result = $stackable->getContainers();
print_r($result);

To get single containers, (*7)

$result = $stackable->getContainer('CONTAINER-ID-HERE');
print_r($result);

To get all items within single container, (*8)

$result = $stackable->getContainerItems('CONTAINER-ID-HERE');
print_r($result);

To get all items within stack, (*9)

$result = $stackable->getAllItems();
print_r($result);

To get single item, (*10)

$result = $stackable->getItem('ITEM-ID-HERE');
print_r($result);

To create new item, (*11)

  • First initialize, using PRIVATE KEY, (MAKE SURE YOU KEEP THIS KEY SAFE! MOSTLY ON SERVER SIDE)
$stackable = new Stackable('YOUR-STACK-PRIVATE-KEY-HERE');
var dataToPost = [
    name => 'John Doe',
    age => 29
];

$result = $stackable->createItem('CONTAINER-ID-HERE', dataToPost);
print_r($result);

To update an item, (*12)

var dataToPost = [
    name => 'John Doe',
    age => 29
];

$result = $stackable->updateItem('ITEM-ID-HERE', dataToPost);
print_r($result);

To play with this library: https://beta.tehplayground.com/D85vaCf8xDxKeb8S, (*13)

Todo

  • Write tests.
  • Test create and update item methods

The Versions

21/03 2016

dev-master

9999999-dev

Official Stackable library for PHP

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires

library stackable