PHPackages                             moshuky/file-extend - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. moshuky/file-extend

ActiveLibrary[File &amp; Storage](/categories/file-storage)

moshuky/file-extend
===================

logan file upload sdk

v1.3(4y ago)093MITPHPPHP &gt;=7.1.0

Since Dec 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mikeshoes/php-ali-sdk-old)[ Packagist](https://packagist.org/packages/moshuky/file-extend)[ RSS](/packages/moshuky-file-extend/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

file-extend
===========

[](#file-extend)

文件管理模块分文档文件和视频文件，根据不同网关进行不同文件的处理操作

**一、安装引用**

1、composer.json文件中添加

```
{
    "require": {
        "loganpc/file-extend": "^1.0.0"
    }
}

```

2、执行 cmoposer update

**二、功能说明**

文档文件

`1、 createUploadFile //获取文件上传凭证`

```
use Loganpc\FileUpload\FileUpload;
//配置信息
$config = array(
    'env' => 'sandbox',
    'app_id' => '12000',
    'secret_key'  => '123456',
);
//接口参数
$param = [];
$file = new FileUpload($config);
$result = $file->gateway('file')->createUploadFile($param);

var_dump($result);

```

`2、 backendFileUpload  //文档文件后端直接上传`

```
use Loganpc\FileUpload\FileUpload;
//配置信息
$config = array(
    'env' => 'sandbox',
    'app_id' => '12000',
    'secret_key'  => '123456',
);
//接口参数
$param = [
    'path' => '/your bucket file path/',
    'file' => [
        'name' => 'your file name',
        'tmp_name' => 'your_file_path',
    ],
];
$file = new FileUpload($config);
$result = $file->gateway('file')->backendFileUpload($param);

var_dump($result);

```

视频文件

`1、 createUploadVideo  //获取视频上传凭证`

```
use Loganpc\FileUpload\FileUpload;
//配置信息
$config = array(
    'env' => 'sandbox',
    'app_id' => '12000',
    'secret_key'  => '123456',
);
//接口参数
$param = [
    'file_name' => '1.mp4',
];
$file = new FileUpload($config);
$result = $file->gateway('media')->createUploadVideo($param);

var_dump($result);

```

`2、 refreshUploadVideo  //更新视频上传凭证`

```
use Loganpc\FileUpload\FileUpload;
//配置信息
$config = array(
    'env' => 'sandbox',
    'app_id' => '12000',
    'secret_key'  => '123456',
);
//接口参数
$param = [
    'vedio_id' => '1183',
];
$file = new FileUpload($config);
$result = $file->gateway('media')->refreshUploadVideo($param);

var_dump($result);

```

`3、 queryMediaInfoByVideoId  //视频转码状态查询`

```
use Loganpc\FileUpload\FileUpload;
//配置信息
$config = array(
    'env' => 'sandbox',
    'app_id' => '12000',
    'secret_key'  => '123456',
);
//接口参数
$param = [
    'vedio_id' => '1183',
];
$file = new FileUpload($config);
$result = $file->gateway('media')->queryMediaInfoByVideoId($param);

var_dump($result);

```

`4、 getPlayInfo  //获取播放地址`

```
use Loganpc\FileUpload\FileUpload;
//配置信息
$config = array(
    'env' => 'sandbox',
    'app_id' => '12000',
    'secret_key'  => '123456',
);
//接口参数
$param = [
    'vedio_id' => '1183',
];
$file = new FileUpload($config);
$result = $file->gateway('media')->getPlayInfo($param);

var_dump($result);

```

`5、 getPlayAuth  //获取播放凭证`

```
use Loganpc\FileUpload\FileUpload;
//配置信息
$config = array(
    'env' => 'sandbox',
    'app_id' => '12000',
    'secret_key'  => '123456',
);
//接口参数
$param = [
    'vedio_id' => '1183',
];
$file = new FileUpload($config);
$result = $file->gateway('media')->getPlayAuth($param);

var_dump($result);

```

`6、 backendVideoUpload  //后端上传阿里视频点播系统`

```
use Loganpc\FileUpload\FileUpload;

$file = $_FILES['file'];

$filePath = base_path() . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . $file['name'];

move_uploaded_file($file["tmp_name"], $filePath);

$config = [
    'env' => 'sandbox',
    'app_id' => '12000',
    'secret_key' => '123456',
];
$param  = [
    'title' => '13810332846',
    'file_path' => $filePath,
];
$file   = new FileUpload($config);
$result = $file->gateway('media')->backendVideoUpload($param);
dd($result);

```

`7、 backendGetPlayInfo  //后端获取阿里视频点播内容`

```
use Loganpc\FileUpload\FileUpload;

$file = $_FILES['file'];

$filePath = base_path() . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . $file['name'];

move_uploaded_file($file["tmp_name"], $filePath);

$config = [
    'env' => 'sandbox',
    'app_id' => '12000',
    'secret_key' => '123456',
];
$param  = [
    'video_id' => 'xxxxx',
];
$file   = new FileUpload($config);
$result = $file->gateway('media')->backendGetPlayInfo($param);
dd($result);

```

`8、 backendGetPlayAuth  //后端获取阿里视频点播播放权限`

```
use Loganpc\FileUpload\FileUpload;

$file = $_FILES['file'];

$filePath = base_path() . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . $file['name'];

move_uploaded_file($file["tmp_name"], $filePath);

$config = [
    'env' => 'sandbox',
    'app_id' => '12000',
    'secret_key' => '123456',
];
$param  = [
    'video_id' => 'xxxxx',
];
$file   = new FileUpload($config);
$result = $file->gateway('media')->backendGetPlayAuth($param);
dd($result);

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Every ~0 days

Total

2

Last Release

1610d ago

### Community

Maintainers

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

---

Top Contributors

[![mikeshoes](https://avatars.githubusercontent.com/u/19601201?v=4)](https://github.com/mikeshoes "mikeshoes (5 commits)")

---

Tags

PHP7oss

### Embed Badge

![Health badge](/badges/moshuky-file-extend/health.svg)

```
[![Health](https://phpackages.com/badges/moshuky-file-extend/health.svg)](https://phpackages.com/packages/moshuky-file-extend)
```

###  Alternatives

[jacobcyl/ali-oss-storage

aliyun oss filesystem storage for laravel 5+

523566.2k7](/packages/jacobcyl-ali-oss-storage)[johnlui/aliyun-oss

阿里云 OSS 官方 SDK 的 Composer 封装，支持任何 PHP 项目，包括 Laravel、Symfony、TinyLara 等等。

501178.3k6](/packages/johnlui-aliyun-oss)[alphasnow/aliyun-oss-laravel

alibaba cloud object storage service for laravel

182240.7k2](/packages/alphasnow-aliyun-oss-laravel)[iidestiny/flysystem-oss

Flysystem adapter for the Oss storage.

95607.5k26](/packages/iidestiny-flysystem-oss)[yangyifan/upload

上传 SDK for Laravel

12422.6k3](/packages/yangyifan-upload)[luoyy/ali-oss-storage

aliyun oss filesystem storage for laravel 9+

1529.9k1](/packages/luoyy-ali-oss-storage)

PHPackages © 2026

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