PHPackages                             yan9/etocdn - 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. yan9/etocdn

ActiveLibrary

yan9/etocdn
===========

Laravel package

v1.2(4y ago)0413MITPHPPHP &gt;=7.0

Since Feb 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Yan9Zhen9/WoaapEtoCDN)[ Packagist](https://packagist.org/packages/yan9/etocdn)[ RSS](/packages/yan9-etocdn/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (16)Used By (0)

yan9/etocdn
===========

[](#yan9etocdn)

Laravel package

Require
-------

[](#require)

Installation:

`composer require yan9/etocdn`

In `config/app.php` add this line to providers array:

`Yan9\Etocdn\EtocdnOssServiceProvider::class,`

Configuration
-------------

[](#configuration)

```
'disks' => [
    ...
    'etocdn' => [
        'driver'        => 'etocdn',
        'accessKey'     => env('ETOCDN_ACCESS_KEY'),
        'secretKey'     => env('ETOCDN_SECRET_KEY'),
        'accessOrg'     => env('ETOCDN_ACCESS_ORG'),
        'accessBrand'   => env('ETOCDN_ACCESS_BRAND'),
        'accessIdcInfo' => env('ETOCDN_ACCESS_IDCINFO'),    // 北京传1，苏州传2，深圳传3
        'cdnEnv'        => env('ETOCDN_CDNENV'),            // PROD 为正式，其他全部为测试
        'accessOs'      => env('ETOCDN_ACCESS_OS'),         // crm传1，etoshop传2，s2m传3，EMCN传4
        'endpoint'      => '',
        'cdnDomain'     => '',
        'ssl'           => true,
        'isCName'       => false,
        'debug'         => false,
    ],
    ...
]

```

Usage
-----

[](#usage)

```
    $image = $request->file('file');

    if (!$image->isValid()) {
        return '上传失败';
    }

    $ext = $image->getClientOriginalExtension();
    $realPath = $image->getRealPath();
    $filename = str_random() . '.' . $ext;
    $filename = trim($filename, '/');

    $storage = \Illuminate\Support\Facades\Storage::disk('etocdn');
    Log::debug('OSS config:', [$filename]);

    // 上传文件
    $result = $storage->put($filename, file_get_contents($realPath));
    if (!$result) return false;
    var_dump($storage->url($filename));

    // 上传单个url
    $filename = 'aaaa.jpg';
    $realPath = 'https://cdn.zxlycr.top/37/2021-02-24/37_20210224191240114.jpg';

    $result = $storage->put($filename, $realPath);
    if (!$result) return false;
    var_dump($storage->url($filename));

    // 批量上传url
    // 如果需要自定义文件名称，请用单个url上传，批量上传不会采用自定义文件名称
    // BatchUpload 为批量上传标识
    // 上传会保留原始路径，如果以“/”结尾，会将“/”去掉
    $realPath = [
    'https://cdn.zxlycr.top/37/2021-02-24/37_20210224191240114.jpg',
    'https://cdn.zxlycr.top/37/2021-02-25/aaaa.jpg'
    ];

    $result = $storage->put('BatchUpload', serialize($realPath));
    if (!$result) return false;
    var_dump($storage->url($realPath));

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Recently: every ~45 days

Total

14

Last Release

1726d ago

Major Versions

v0.0.8 → v1.0.02021-02-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/d305bc47a995b90d9660a330381c89ffefde2f5ac47b3cea098c92da4456feb1?d=identicon)[young.zheng](/maintainers/young.zheng)

---

Top Contributors

[![Yan9Zhen9](https://avatars.githubusercontent.com/u/79251087?v=4)](https://github.com/Yan9Zhen9 "Yan9Zhen9 (17 commits)")

### Embed Badge

![Health badge](/badges/yan9-etocdn/health.svg)

```
[![Health](https://phpackages.com/badges/yan9-etocdn/health.svg)](https://phpackages.com/packages/yan9-etocdn)
```

PHPackages © 2026

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