定制 nextdeveloper/publitio 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nextdeveloper/publitio

最新稳定版本:v1.0.1

Composer 安装命令:

composer require nextdeveloper/publitio

包简介

PHP language interface for the Publitio RESTful API

README 文档

README

ℹ️ We created this library to be able to use it with composer and maintain the library to support various Laravel versions.

Original documentation is as below;

Publitio PHP SDK

PHP SDK for Publitio API. This SDK works with PHP version 5.5 and up.

Deprecated version

Version 1 of this SDK has been deprecated and its use is discouraged. You can find the deprecated version on the deprecated branch.

Installation

This SDK is installed via Composer.

Install Composer if you haven't already:

curl -sS https://getcomposer.org/installer | php

Install the Publitio SDK:

php composer.phar require publitio/publitio

If you have already installed Composer globally, use:

composer require publitio/publitio

After installing, require the Composer autoloader:

require 'vendor/autoload.php';

Usage

The \Publitio\API class presents the main interface to the Publitio RESTful API. You can find more documentation about Publitio here.

To instantiate the API class, provide your API key and API secret (which you can find on your Publitio dashboard):

$publitio = new \Publitio\API('<API Key>', '<API Secret>');

To Make an API call, use the call method:

$response = $publitio->call($call_url, $method, $args);

For a list of available calls, see the docs.

  • $call_url is the API call URL, for example '/files/list'.

  • $method is the HTTP method, for example 'GET' or 'DELETE'. Which of these you need depends on what kind of call you are making. The method for each API URL is documented at the docs.

  • $args is an array of URL query parameters, such as array('public_id' => 'foo').

  • $response will be the response JSON parsed using json_decode. Note: this is a PHP object, not an array.

Use the call method when you aren't going to be uploading any files with the call. If you wish to upload a file, use the uploadFile or uploadRemoteFile methods:

$publitio->uploadFile(fopen('path/to/file.png', 'r'));

Documentation

For complete documentation of this SDK, see this page.

Example

For plenty more usage examples, see the examples directory.

$publitio = new \Publitio\API('<API Key>', '<API secret>');
$response = $publitio->call('/files/list', 'GET', array('offset' => '0', 'limit' => '10'));
var_dump($response);

统计信息

  • 总下载量: 1.51k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-05-24