2017 © Pedro Peláez
 

library yb-openapi-sdk-php

yb-openapi-sdk-php

image

yuanben/yb-openapi-sdk-php

yb-openapi-sdk-php

  • Thursday, May 11, 2017
  • by DearMadMan
  • Repository
  • 3 Watchers
  • 3 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

Yuanben/yb-openapi-sdk-php

Usage

Media

$config = new Config($token, Config::USER_MEDIA);

$client = new Client($config);

$title = 'Hello World.';
$content = 'DearMadMan.';
$article = new Article($title, $content);

$license = new License(License::LICENSE_CC);
$license->setAdaptation(License::LICENSE_CC_ADAPTATION_Y)->setCommercial(License::LICENSE_CC_COMMERCIAL_N);

$article->setLicense($license);

$response = $client->post($article);

var_dump($response instanceof Article);

// multiple data
$collect = new Collection();

$article2 = new Article('The Title Of Article 2.', 'The Body.');
$article2->setLicense($license);

$collect->push($article)->push($article2);

$response = $client->post($collect);

var_dump($response instanceof Colletion);

Platform

$config = new Config($token, Config::USER_PLATFORM);

$client = new Client($config);

$title = 'Hello World.';
$content = 'DearMadMan.';
$article = new Article($title, $content);

$license = new License(License::LICENSE_CC);
$license->setAdaptation(License::LICENSE_CC_ADAPTATION_Y)->setCommercial(License::LICENSE_CC_COMMERCIAL_N);

$author = new Author('i@dearmadman.com', 'DearMadMan.');

$article->setLicense($license)
    ->setAuthor($author);

$response = $client->post($article);


// multiple data
$collect = new Collection();

$article2 = new Article('The Title Of Article 2.', 'The Body.');
$article2->setLicense($license)
    ->setAuthor($author);

$collect->push($article)->push($article2);

$response = $client->post($collect);


License Instance

$license = License::fromJson($json);

Exception

try {
$response = $client->post($collect);
} catch (\Exception $e) {
    echo $e->getMessage();
}

The Versions

11/05 2017

dev-master

9999999-dev https://github.com/yuanbenio/yb-openapi-sdk-php

yb-openapi-sdk-php

  Sources   Download

MIT

The Requires

 

10/05 2017

v1.0.8

1.0.8.0 https://github.com/yuanbenio/yb-openapi-sdk-php

yb-openapi-sdk-php

  Sources   Download

MIT

The Requires

 

06/05 2017

v1.0.7

1.0.7.0

yb-openapi-sdk-php

  Sources   Download

MIT

The Requires

 

26/04 2017

v1.0.6

1.0.6.0

yb-openapi-sdk-php

  Sources   Download

MIT

The Requires

 

19/04 2017

v1.0.5

1.0.5.0

yb-openapi-sdk-php

  Sources   Download

MIT

The Requires

 

19/04 2017

v1.0.4

1.0.4.0

yb-openapi-sdk-php

  Sources   Download

MIT

The Requires

 

19/04 2017

v1.0.2

1.0.2.0

yb-openapi-sdk-php

  Sources   Download

MIT

The Requires

 

19/04 2017

v1.0.1

1.0.1.0

yb-openapi-sdk-php

  Sources   Download

MIT

The Requires

 

14/04 2017

v1.0.0

1.0.0.0

yb-openapi-sdk-php

  Sources   Download

MIT

The Requires