PHPackages                             ltqio/upyun-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ltqio/upyun-php-sdk

ActiveLibrary[API Development](/categories/api)

ltqio/upyun-php-sdk
===================

Modern fork of the official Upyun PHP SDK with PHP 8.3 support, PHPUnit 9 compatibility, and Laravel 12 support.

v1.0.0(10mo ago)01MITPHPPHP &gt;=8.3CI passing

Since Jun 21Pushed 10mo agoCompare

[ Source](https://github.com/ltqio/upyun-php-sdk)[ Packagist](https://packagist.org/packages/ltqio/upyun-php-sdk)[ Docs](https://github.com/ltqio/upyun-php-sdk)[ RSS](/packages/ltqio-upyun-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Upyun PHP SDK (Unofficial Fork for PHP 8.3 &amp; Laravel 12)
============================================================

[](#upyun-php-sdk-unofficial-fork-for-php-83--laravel-12)

[![test](https://github.com/ltqio/upyun-php-sdk/actions/workflows/test.yml/badge.svg)](https://github.com/ltqio/upyun-php-sdk/actions/workflows/test.yml)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7a185f6f76c878623d904be7f631a04daee1c1fe59356d086f4b49a62ee84bfa/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c7471696f2f757079756e2d7068702d73646b2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ltqio/upyun-php-sdk/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/da300cc10903889e9fcd3d25855b5aabd4d1cea3db5139e87889ffe34abb5e4a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c7471696f2f757079756e2d7068702d73646b2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ltqio/upyun-php-sdk/?branch=master)[![Build Status](https://camo.githubusercontent.com/b8a31f9027a3161dea7ffbbd02c816da8b0a6268f2cae33a00611dd3c32b8fdc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c7471696f2f757079756e2d7068702d73646b2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ltqio/upyun-php-sdk/build-status/master)[![Code Intelligence Status](https://camo.githubusercontent.com/7ba7c3217ae4527c64f79e6efa39046560dda3cefd868e3c4bc690d7606d1e5f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c7471696f2f757079756e2d7068702d73646b2f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/g/ltqio/upyun-php-sdk/?branch=master)

[![Latest Stable Version](https://camo.githubusercontent.com/06d1bfac6b46ccaf2f2a7a7e1cad9ef08250c8a693329a65901ae095eb2875f0/68747470733a2f2f706f7365722e707567782e6f72672f6c7471696f2f757079756e2d7068702d73646b2f762f737461626c65)](https://packagist.org/packages/ltqio/upyun-php-sdk)[![Total Downloads](https://camo.githubusercontent.com/a124c0254ca76aa41cf2c6dfb06fa54caa1421524dcf708193d6eb356cbf0289/68747470733a2f2f706f7365722e707567782e6f72672f6c7471696f2f757079756e2d7068702d73646b2f646f776e6c6f616473)](https://packagist.org/packages/ltqio/upyun-php-sdk)

> ⚠️ **免责声明 / DISCLAIMER：本仓库为非官方维护版本**

本项目基于官方 [`upyun/php-sdk`](https://github.com/upyun/php-sdk) 进行修改，主要用于适配：

- PHP 8.3+
- Laravel 12+
- Guzzle 7+

📝 查看完整更新日志：[CHANGELOG.md](CHANGELOG.md)

**本项目与又拍云官方无直接关系，不代表官方立场或技术支持。请谨慎用于生产环境。**如需官方版本请访问：

---

又拍云 PHP SDK，封装了[又拍云功能丰富的开放 API](http://docs.upyun.com/api/) ，帮助开发者快速对接文件云端存储、图片音视频云处理、智能鉴黄等功能

- [功能列表](#list)
- [使用说明](#use-instructions)
    - [安装](#install)
    - [文档](#doc)
    - [示例](#usage)
- [贡献代码](#contribute)
- [社区](#community)
- [许可证](#license)

功能列表
----

[](#功能列表)

SDK 包含如下功能

- 基于 [rest api](http://docs.upyun.com/api/rest_api/)
    - 文件上传下载、目录创建删除等云存储基本操作
    - [断点续传](http://docs.upyun.com/api/rest_api/#_3)
- 基于 [form api](http://docs.upyun.com/api/form_api/)
    - 文件客户端上传 见`examples/client-upload`
    - 上传预处理操作
        - [同步音频处理](http://docs.upyun.com/cloud/sync_audio/)
        - [文档转换](http://docs.upyun.com/cloud/uconvert/)
        - [异步图片音视频处理](http://docs.upyun.com/api/form_api/#_7)
        - [异步图片智能鉴黄](http://docs.upyun.com/ai/audit/)
- [异步云处理](http://docs.upyun.com/cloud/)
    - [视频音频](http://docs.upyun.com/cloud/av/)异步转码、切片、截图、水印、剪辑、拼接等功能
    - [文件异步解压缩](http://docs.upyun.com/cloud/unzip/)
    - [文件异步拉取](http://docs.upyun.com/cloud/spider/)
    - [异步图片拼接](http://docs.upyun.com/cloud/async_image/)
- [同步视频处理](http://docs.upyun.com/cloud/sync_video/)：m3u8 文件同步拼接剪辑、其他视频文件同步截图功能
- [缓存刷新](http://docs.upyun.com/api/purge/)

*功能列表中的异步操作，均可以设置异步回调通知地址，接收异步处理结果**如果需要测试回调功能，可以通过[又拍云回调服务](https://hooks.upyun.com/)创建一个临时回调地址*

使用说明
----

[](#使用说明)

### 安装

[](#安装)

#### PHP &gt;= 8.3

[](#php--83)

1.使用 `composer` 安装

推荐使用该方法安装，成为优雅的 PHPer 🔥

建议使用速度很快的国内[全量镜像](https://pkg.phpcomposer.com/#how-to-use-packagist-mirror)([又拍云赞助](https://pkg.phpcomposer.com/#donation))

```
composer require ltqio/upyun-php-sdk

```

### 文档

[](#文档)

详细文档见 [doc.md](doc.md)

### 示例

[](#示例)

先初始化又拍云服务配置：

```
require_once('vendor/autoload.php');

use Upyun\Upyun;
use Upyun\Config;
$serviceConfig = new Config('yourServiceName', 'yourOperatorName', 'yourOperatorPwd');
$client = new Upyun($serviceConfig);
```

#### 字符串写入又拍云服务器

[](#字符串写入又拍云服务器)

```
$client->write('/save/path', 'file content');

```

#### 文件流写入又拍云服务器

[](#文件流写入又拍云服务器)

```
$file = fopen('/local/path/file', 'r');
$client->write('/save/path', $file);

```

#### 使用并行式断点续传上传文件

[](#使用并行式断点续传上传文件)

```
$serviceConfig->setUploadType('BLOCK_PARALLEL');
$client = new Upyun($serviceConfig);
$file = fopen('/local/path/file', 'r');
$client->write('/save/path', $file);

```

#### 上传图片并转换格式为 `png`，详见[上传作图](http://docs.upyun.com/cloud/image/#_2)

[](#上传图片并转换格式为-png详见上传作图)

```
$file = fopen('/local/path/image.jpg', 'r');
$client->write('/save/image.png', $file, array('x-gmkerl-thumb' => '/format/png'));

```

#### 下载文件并保存到本地

[](#下载文件并保存到本地)

```
$saveLocal = fopen('/local/path/image.jpg', 'w');
// 第二个参数不传时，read 方法将直接返回文件内容
$client->read('/remote/server/image.png', $saveLocal);

```

贡献代码
----

[](#贡献代码)

1. Fork
2. 为新特性创建一个新的分支
3. 发送一个 pull request 到 master 分支

社区
--

[](#社区)

- [问答社区](http://segmentfault.com/upyun)
- [微博](http://weibo.com/upaiyun)

许可证
---

[](#许可证)

UPYUN PHP-SDK 基于 MIT 开源协议

🛡️ 关于本 Fork
-----------

[](#️-关于本-fork)

- 本项目由社区开发者 fork 并适配新版本 PHP 及 Laravel；
- 不承诺完全兼容官方 API，如有疑问请优先参考官方文档；
- 欢迎 Issues 或 PR 协助维护。

---

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance56

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 54.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

321d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bad7d4a7348c6739f6426829a8293371f2b09e883fea75a2facf11a5abeb3fed?d=identicon)[ltqio](/maintainers/ltqio)

---

Top Contributors

[![sabakugaara](https://avatars.githubusercontent.com/u/3990917?v=4)](https://github.com/sabakugaara "sabakugaara (112 commits)")[![ltqio](https://avatars.githubusercontent.com/u/217215251?v=4)](https://github.com/ltqio "ltqio (43 commits)")[![lfeng](https://avatars.githubusercontent.com/u/103457?v=4)](https://github.com/lfeng "lfeng (39 commits)")[![our80](https://avatars.githubusercontent.com/u/2969393?v=4)](https://github.com/our80 "our80 (3 commits)")[![phy25](https://avatars.githubusercontent.com/u/331403?v=4)](https://github.com/phy25 "phy25 (1 commits)")[![timebug](https://avatars.githubusercontent.com/u/416154?v=4)](https://github.com/timebug "timebug (1 commits)")[![totoleo](https://avatars.githubusercontent.com/u/4956722?v=4)](https://github.com/totoleo "totoleo (1 commits)")[![ckaqq](https://avatars.githubusercontent.com/u/11495438?v=4)](https://github.com/ckaqq "ckaqq (1 commits)")[![yejingx](https://avatars.githubusercontent.com/u/2890050?v=4)](https://github.com/yejingx "yejingx (1 commits)")[![forthe2008](https://avatars.githubusercontent.com/u/24647448?v=4)](https://github.com/forthe2008 "forthe2008 (1 commits)")[![khs1994](https://avatars.githubusercontent.com/u/16733187?v=4)](https://github.com/khs1994 "khs1994 (1 commits)")[![lvye](https://avatars.githubusercontent.com/u/4340161?v=4)](https://github.com/lvye "lvye (1 commits)")

---

Tags

laravel12php83phpunit9upyunphpsdkforklaravel12php8.3upyunguzzle7

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ltqio-upyun-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/ltqio-upyun-php-sdk/health.svg)](https://phpackages.com/packages/ltqio-upyun-php-sdk)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2292.2M23](/packages/php-opencloud-openstack)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
