PHPackages                             arefshojaei/anchor - 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. arefshojaei/anchor

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

arefshojaei/anchor
==================

PHP local CDN manager

1.0.0(1mo ago)00MITJavaScriptPHP &gt;7.4

Since Jun 16Pushed 1mo agoCompare

[ Source](https://github.com/ArefShojaei/Anchor)[ Packagist](https://packagist.org/packages/arefshojaei/anchor)[ RSS](/packages/arefshojaei-anchor/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

📦 Anchor - PHP Local CDN Manager
================================

[](#-anchor---php-local-cdn-manager)

[![PHP Version](https://camo.githubusercontent.com/17755f71eb6e0d0333a12377049dd4c484bbc503e7b4d7daac876b2b173aac58/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545372e302d626c75652e737667)](https://php.net)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)[![GitHub](https://camo.githubusercontent.com/56073bd17bfb72626e110d709ccbd0685ca7c7d030ad8e4d676b075c9fc81efe/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d416e63686f722d626c61636b3f6c6f676f3d676974687562)](https://github.com/ArefShojaei/Anchor)

A lightweight and powerful **Local CDN Manager** built with PHP. Anchor allows you to download, manage, and serve frontend libraries locally with a simple CLI interface.

Perfect for developers who want a private CDN server without relying on external providers.

[![Cover](https://private-user-images.githubusercontent.com/134844185/552561210-076a955a-0ce3-4afa-b7e5-7e8bffb57769.png?jwt=eyJ0eXAiOiJKV1QiLCJhbG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EEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNzE4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDcxOFQwNTMxMTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wNTIyMjBmNTE3OWEyOTBhYTNhODk5ZWJhMmI1OTRmZmUzODdhNjg2NDhjZGY3MWNjZDA4MjIzMzZhZmVjYzVhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.8W4c4lBSA5IxnAj_QgcEgogcJXwDOOF1lFPs0vDokvQ)---

✨ Features
----------

[](#-features)

- 📦 **Package Management** - Store and manage frontend libraries locally
- 🚀 **One Click Installation** - Download multiple CDN packages using a single command
- 🖥️ **Built-in HTTP Server** - Serve your local CDN directly from CLI
- 📝 **Package List Support** - Manage packages using a simple text configuration file
- ⚡ **Fast &amp; Lightweight** - Pure PHP implementation with minimal dependencies
- 🛠️ **CLI Interface** - Simple and developer-friendly commands
- 🔧 **Custom Host &amp; Port** - Configure your local server easily

---

📥 Installation
==============

[](#-installation)

Requirements
------------

[](#requirements)

- PHP 7.0 or higher
- Composer (recommended)
- Bash environment (optional for bulk downloads)

---

Using Composer
--------------

[](#using-composer)

```
composer create-project arefshojaei/anchor my-cdn
```

Move into the project directory:

```
cd my-cdn
```

---

Clone Repository
----------------

[](#clone-repository)

```
git clone https://github.com/ArefShojaei/Anchor.git
```

Then:

```
cd Anchor
composer install
```

---

📋 CDN Package List
==================

[](#-cdn-package-list)

Anchor supports bulk package installation using a package list.

Location:

```
public/packages.txt
```

File format:

```
# [Category]
[package] [version] [url]
```

Example:

```
# CSS Frameworks
bootstrap 5.3.8 https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css

# JavaScript Libraries
jquery 3.7.1 https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js
```

---

🚀 One Click Package Download
----------------------------

[](#-one-click-package-download)

If your environment supports Bash, run:

```
bash scripts/downloader.sh
```

This script reads `packages.txt` and downloads all defined packages automatically.

---

🛠 CLI Commands
==============

[](#-cli-commands)

Add a new CDN package
---------------------

[](#add-a-new-cdn-package)

Pattern:

```
php bin/cli cdn add [package] [version] [url]
```

Example:

```
php bin/cli cdn add bootstrap 5.3.8 https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css
```

---

Start Local CDN Server
----------------------

[](#start-local-cdn-server)

Basic:

```
php bin/cli serve
```

Custom port:

```
php bin/cli serve --port:3000
```

Custom host:

```
php bin/cli serve --host:0.0.0.0
```

Custom host and port:

```
php bin/cli serve --host:0.0.0.0 --port:3000
```

---

After running the server, open your browser:

```
http://[host]:[port]
```

Your local packages and files inside the `public/` directory will be available through this address.

---

📂 Project Structure
===================

[](#-project-structure)

```
Anchor/
│
├── bin/
│   └── cli                 # CLI application
│
├── public/
│   ├── packages.txt        # CDN package definitions
│   └── packages/           # Downloaded libraries
│
├── scripts/
│   └── downloader.sh       # Bulk package downloader
│
├── src/                    # Core application source
│
├── composer.json
└── README.md
```

---

💡 Example Workflow
==================

[](#-example-workflow)

### 1. Add a package

[](#1-add-a-package)

```
php bin/cli cdn add alpinejs 3.14.0 https://cdn.jsdelivr.net/npm/alpinejs@3.14.0/dist/cdn.min.js
```

### 2. Start the server

[](#2-start-the-server)

```
php bin/cli serve --port:8080
```

### 3. Use your local CDN

[](#3-use-your-local-cdn)

```

```

---

🔥 Why Anchor?
=============

[](#-why-anchor)

Using a local CDN gives you:

- Faster development environment
- Offline availability
- Full control over package versions
- No dependency on third-party CDN availability
- Better privacy for internal applications

---

🤝 Contributing
==============

[](#-contributing)

Contributions are welcome!

1. Fork the repository
2. Create a new branch

```
git checkout -b feature/amazing-feature
```

3. Commit your changes

```
git commit -m "Add amazing feature"
```

4. Push your branch

```
git push origin feature/amazing-feature
```

5. Open a Pull Request

---

👨‍💻 Author
==========

[](#‍-author)

**Aref Shojaei**

- GitHub:
- Email:

---

⭐ Show Your Support
===================

[](#-show-your-support)

If this project helps you, consider giving it a **Star** on GitHub.

It motivates further development and improvements.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance92

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

38d ago

### Community

Maintainers

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

---

Top Contributors

[![ArefShojaei](https://avatars.githubusercontent.com/u/134844185?v=4)](https://github.com/ArefShojaei "ArefShojaei (10 commits)")

---

Tags

anchorcdnfile-uploadlinklocalphpstoragefilelocalcdnexplorerdownloaderoffline

### Embed Badge

![Health badge](/badges/arefshojaei-anchor/health.svg)

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

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k679.9M2.6k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.7k285.7M1.1k](/packages/league-flysystem-aws-s3-v3)[league/flysystem-local

Local filesystem adapter for Flysystem.

227267.1M95](/packages/league-flysystem-local)[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k41.5M134](/packages/knplabs-gaufrette)[league/flysystem-memory

In-memory filesystem adapter for Flysystem.

8737.3M286](/packages/league-flysystem-memory)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

6134.8M164](/packages/league-flysystem-sftp-v3)

PHPackages © 2026

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