PHPackages                             phico/cdn - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. phico/cdn

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phico/cdn
=========

Lightweight CDN support for Phico

02PHP

Since Aug 4Pushed 1y agoCompare

[ Source](https://github.com/phico-php/cdn)[ Packagist](https://packagist.org/packages/phico/cdn)[ RSS](/packages/phico-cdn/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Cdn
===

[](#cdn)

Lightweight CDN support for [Phico](https://github.com/phico-php/phico)

Installation
------------

[](#installation)

Using composer

```
composer require phico/cdn
```

Usage
-----

[](#usage)

CDN provides quick and simple access to AWS S3 and Cloudflare R2 private CDNs.

### Objects

[](#objects)

```
// put a local file on the cdn
$cdn->put('path/to/local/file.txt', '/path/on/cdn/file.txt');

// retrieve the file content
$content = $this->cdn->get('/path/on/cdn/file.txt');

// delete the file
$cdn->delete('/path/on/cdn/file.txt');
```

#### Switching buckets

[](#switching-buckets)

If you have connected with the necessary permissions you can switch buckets.

```
$cdn->bucket('other-bucket')->put('local/file.txt', 'uploads/file.txt');
$cdn->bucket('backup-bucket')->put('local/file.txt', 'uploads/file.txt');
```

### Buckets

[](#buckets)

If you have connected with the necessary permissions you can manage buckets.

```
// list all buckets
$array = $cdn->buckets();

// create a bucket on the cdn
$cdn->bucket('tmp')->create();

// list objects in the bucket
$array = $cdn->bucket('tmp')->list();

// switching a bucket will be remembered so the above two lines could be shortened to
$array = $cdn->bucket('tmp')->create()->list();

// delete the bucket from the cdn
$cdn->bucket('tmp')->delete();
```

Issues
------

[](#issues)

If you discover any bugs or issues with behaviour or performance please create an issue, and if you are able a pull request with a fix.

Please make sure to update tests as appropriate.

For major changes, please open an issue first to discuss what you would like to change.

License
-------

[](#license)

[BSD-3-Clause](https://choosealicense.com/licenses/bsd-3-clause/)

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/65541311?v=4)[indgy](/maintainers/indgy)[@indgy](https://github.com/indgy)

---

Top Contributors

[![indgy](https://avatars.githubusercontent.com/u/65541311?v=4)](https://github.com/indgy "indgy (2 commits)")

### Embed Badge

![Health badge](/badges/phico-cdn/health.svg)

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

###  Alternatives

[zakirullin/mess

Convenient array-related routine &amp; better type casting

21228.9k2](/packages/zakirullin-mess)[clarkwinkelmann/flarum-ext-emojionearea

Add EmojioneArea emoji picker to Flarum

2848.5k2](/packages/clarkwinkelmann-flarum-ext-emojionearea)[dcat-admin-extension/ueditor

百度在线编辑器

205.5k](/packages/dcat-admin-extension-ueditor)[shibuyakosuke/laravel-postalcode-japan

郵便番号データを取り込んで住所マスタを作成します。

105.2k](/packages/shibuyakosuke-laravel-postalcode-japan)

PHPackages © 2026

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