PHPackages                             loganpc/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. loganpc/file-extend

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

loganpc/file-extend
===================

logan file upload sdk

1.0.31(6y ago)11.4kMITPHPPHP &gt;=7.1.0CI failing

Since Apr 7Pushed 6y ago1 watchersCompare

[ Source](https://github.com/loganpc/media-transfer)[ Packagist](https://packagist.org/packages/loganpc/file-extend)[ RSS](/packages/loganpc-file-extend/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (3)Versions (9)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

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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 ~9 days

Recently: every ~4 days

Total

8

Last Release

2210d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c51bfc992c59dc2c50861be48ee2ea29c63c45c1b0b8795a7390a92e1ab3e7a?d=identicon)[logan\_pc](/maintainers/logan_pc)

---

Top Contributors

[![loganpc](https://avatars.githubusercontent.com/u/38307047?v=4)](https://github.com/loganpc "loganpc (6 commits)")

---

Tags

PHP7oss

### Embed Badge

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

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[google/cloud

Google Cloud Client Library

1.2k16.5M57](/packages/google-cloud)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k34](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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