arefshojaei/anchor
Composer 安装命令:
composer create-project arefshojaei/anchor
包简介
PHP local CDN manager
README 文档
README
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.
✨ 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 & Lightweight - Pure PHP implementation with minimal dependencies
- 🛠️ CLI Interface - Simple and developer-friendly commands
- 🔧 Custom Host & Port - Configure your local server easily
📥 Installation
Requirements
- PHP 7.0 or higher
- Composer (recommended)
- Bash environment (optional for bulk downloads)
Using Composer
composer create-project arefshojaei/anchor my-cdn
Move into the project directory:
cd my-cdn
Clone Repository
git clone https://github.com/ArefShojaei/Anchor.git
Then:
cd Anchor
composer install
📋 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
If your environment supports Bash, run:
bash scripts/downloader.sh
This script reads packages.txt and downloads all defined packages automatically.
🛠 CLI Commands
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
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
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
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
php bin/cli serve --port:8080
3. Use your local CDN
<script src="http://localhost:8080/packages/alpinejs/3.14.0/cdn.min.js"></script>
🔥 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
Contributions are welcome!
- Fork the repository
- Create a new branch
git checkout -b feature/amazing-feature
- Commit your changes
git commit -m "Add amazing feature"
- Push your branch
git push origin feature/amazing-feature
- Open a Pull Request
👨💻 Author
Aref Shojaei
- GitHub: https://github.com/ArefShojaei
- Email: arefshojaei82@gmail.com
⭐ Show Your Support
If this project helps you, consider giving it a Star on GitHub.
It motivates further development and improvements.
arefshojaei/anchor 适用场景与选型建议
arefshojaei/anchor 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「file」 「cdn」 「downloader」 「local」 「explorer」 「offline」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 arefshojaei/anchor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 arefshojaei/anchor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 arefshojaei/anchor 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The NzoFileDownloaderBundle is a Symfony Bundle used to Download all types of files from servers and Web applications safely and with ease. You can also read/show the file content in the Web Browser.
The file manager intended for using Laravel with CKEditor / TinyMCE / Colorbox
PHP powered alternative for youtube-dl
Utility for downloading Microsoft Edge Driver binary with browser version detection
Downloader Library
selenium-server-standalone, ChromeDriver, geckodriver and IEDriverServer downloader.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 34
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-10