fcs/fcs-sdk-php
Composer 安装命令:
composer require fcs/fcs-sdk-php
包简介
FCS SDK for PHP
README 文档
README
The FCS SDK for PHP enables PHP developers to build solutions with Firebrand Cloud Services (FCS). With the FCS SDK for PHP, developers can get started in minutes by using Composer.
This new version is built on top of Guzzle, a PHP HTTP client framework, which provides increased performance. The FCS SDK for PHP requires PHP 5.4.
Before Using the SDK
There is some basic information you need to know before you get started using the SDK.
Signing Up for FCS
First your organization must be setup with Firebrand Technologies Title Management and Content Services.
Configuration Settings for FCS
Your FCS Configuration Settings will be sent to your organization.
Installing the SDK
Using Composer is the recommended way to install the FCS SDK for PHP . Composer is dependency management tool for PHP that allows you to declare the dependencies your project needs and installs them into your project. In order to use the FCS SDK for PHP through Composer, you must do the following:
-
Add
"fcs/fcs-sdk-php"as a dependency in your project'scomposer.jsonfile.{ "require": { "fcs/fcs-sdk-php": "*" } } -
Download and install Composer.
curl -s "http://getcomposer.org/installer" | php -
Install your dependencies.
php composer.phar install -
Require Composer's autoloader.
Composer also prepares an autoload file that's capable of autoloading all of the classes in any of the libraries that it downloads. To use it, just add the following line to your code's bootstrap process.
require '/path/to/sdk/vendor/autoload.php';
You can find out more on how to install Composer, configure autoloading, and other best-practices for defining dependencies at getcomposer.org.
Using the SDK
Quick Start
To get started downloading a file from FCS you can do the following:
<?php // Include the SDK along with you other project dependencies // using the Composer autoloader require 'vendor/autoload.php'; use Fcs\Fcs; use Fcs\AssetTypes; $fcs = new Fcs(array( 'url' => 'fcs-services-url', 'key' => 'your-fcs-access-key', 'secret' => 'your-fcs-access-secret', // chunkSize is optional. When uploading a file, sets how many bytes are sent at a time. // The default is 1048576, which is 1 MB. 'chunkSize' => 1048576, )); $uri = $fcs->getAssetUriByEan("9780306406157", // EAN/ISBN13 of the book to download "epub", // See Asset Types below 9.99, // Digital list or sales price // If this is null or "", // the TMM price will be used get_current_user()); // This is a unique id or name of the // current user. Used to determine // downloads per user. header("Location: $uri");
Asset Types
The following is a list of the asset types that can be used in getAssetUriByEan. Auto asset types are used if your account is configured to do Auto DRM conversion. If conversion requests are made manually, the non Auto asset types are used instead.
| Asset Type | Description |
|---|---|
| "epub" | Unprotected (Open) EPUB |
| "publisherkindle" | Mobi (created by the publisher, rathern than being auto converted from an EPUB) |
| "pdf" | Unprotected (Open) PDF |
| "tdrmepubauto" | Temporarily (55 days) Protected (Adobe DRM) EPUB. Auto converted. |
| "tdrmpdfauto" | Temporarily (55 days) Protected (Adobe DRM) PDF. Auto converted. |
| "tdrmauto" | Temporarily (55 days) Protected (Adobe DRM) asset (EPUB if it exists; PDF otherwise). Auto converted. |
| "tdrmepub" | Temporarily (55 days) Protected (Adobe DRM) EPUB. Manually converted. |
| "tdrmpdf" | Temporarily (55 days) Protected (Adobe DRM) PDF. Manually converted. |
| "tdrm" | Temporarily (55 days) Protected (Adobe DRM) asset (EPUB if it exists; PDF otherwise). Manually converted. |
| "pdrmepubauto" | Permanently Protected (Adobe DRM) EPUB. Auto converted. |
| "pdrmpdfauto" | Permanently Protected (Adobe DRM) PDF. Auto converted. |
| "pdrmauto" | Permanently Protected (Adobe DRM) asset (EPUB if it exists; PDF otherwise). Auto converted. |
| "pdrmepub" | Permanently Protected (Adobe DRM) EPUB. Manually converted. |
| "pdrmpdf" | Permanently Protected (Adobe DRM) PDF. Manually converted. |
| "pdrm" | Permanently Protected (Adobe DRM) asset (EPUB if it exists; PDF otherwise). Manually converted. |
| "enthrillepub" | Enthrill (Social DRM) EPUB. Manually converted. |
| "enthrillpdf" | Enthrill (Social DRM) PDF. Manually converted. |
| "enthrillepubauto" | Enthrill (Social DRM) EPUB. Auto Converted. |
| "enthrillpdfauto" | Enthrill (Social DRM) PDF. Auto Converted. |
| "ancillaryzip" | Unprotected zip file that is associated with a title but ancillary to it. |
| "ancillarypdf" | Unprotected PDF file that is associated with a title but ancillary to it. |
| "ancillarypdrmpdf" | Permanently Protected (Adobe DRM) PDF that is associated with a title but ancillary to it. Auto converted. |
fcs/fcs-sdk-php 适用场景与选型建议
fcs/fcs-sdk-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12.78k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2012 年 12 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 fcs/fcs-sdk-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 fcs/fcs-sdk-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 12.78k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2012-12-05