lcsng/amanda
Composer 安装命令:
composer require lcsng/amanda
包简介
Amanda is a lightweight and flexible PHP routing library that dynamically maps website URLs to template files without requiring manual route definitions or directory structures. Simply place your .php or .html templates inside the amanda_templates/ directory, and Amanda will automatically serve them
README 文档
README
🚀 Amanda is a powerful and flexible PHP routing library that dynamically maps URLs to template files without requiring manual route definitions. It provides a simple yet robust way to handle requests, making web development faster and more efficient.
📌 Key Features
✅ Auto-routing – No need to manually define routes; Amanda maps URLs to templates automatically.
✅ Customizable & Lightweight – Easily modify template paths and routing logic.
✅ Dedicated Public Directory – Follows best practices by keeping core files separate from publicly accessible assets.
✅ Seamless Integration – Works with both existing PHP projects and new installations.
📥 Installation
1️⃣ Install Amanda as a Full Project
Amanda should be installed in a server directory that is not publicly accessible. You can install it using:
composer create-project lcsng/amanda my-site
This will create a my-site/ directory containing all necessary files and folders.
📂 Folder Structure
Amanda follows this directory setup:
my-site/ # Server directory (not public)
├── amanda/ # Core framework files (configs, functions, templates, etc.)
│ ├── amanda_templates/ # User templates (PHP/HTML)
│ ├── amanda_routers/ # Routing logic
│ └── ... (other core files)
│
├── public_html/ # The document root (publicly accessible files)
│ ├── index.php # Handles all requests
│ ├── amanda_ajax.php # For AJAX requests
│ ├── amanda_assets/ # Public assets (CSS, JS, images, etc.)
│ └── ... (other public files)
│
└── composer.json # Project dependencies
Folder Placement Notes:
🔹 my-site/ is not the document root—it is the server directory.
🔹 public_html/ is the document root, where web requests are directed.
🔹 Users can place Amanda anywhere that fits their project structure.
🚀 Getting Started
1️⃣ Place Your Templates
Simply put your .php or .html files inside the amanda/amanda_templates/ directory. Amanda will automatically route them based on the requested URL.
For example:
amanda_templates/
├── home.php → Access via `/home`
├── about.html → Access via `/about`
├── contact.php → Access via `/contact`
└── 404.html → Default 404 error page
2️⃣ Configure Routing (Optional)
Modify the amanda_routers/artd.php file to override defaults:
$amanda_router->template_dir = AMANDA_TEMPLATE_DIR; $amanda_router->error_404 = AMANDA_TEMPLATE_DIR . '/404.html'; // Custom template overrides $amanda_router->home = AMANDA_TEMPLATE_DIR . '/home2.php'; $amanda_router->add_template = [ 'cart' => AMANDA_TEMPLATE_DIR . '/cart.php' ];
📚 Documentation
For full documentation, visit lcs.ng/amanda.
🤝 Contributing
- Fork the repository.
- Make your changes.
- Submit a pull request.
📜 License
Amanda is licensed under GPL-3.0-or-later, meaning it is free to use, modify, and distribute while ensuring derivatives remain open-source.
📧 Contact & Support
📌 Author: Chinonso Frewen Justice (JCFuniverse)
📧 Email: amanda@lcs.ng
🌐 Website: lcs.ng/amanda
lcsng/amanda 适用场景与选型建议
lcsng/amanda 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 03 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 lcsng/amanda 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lcsng/amanda 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2025-03-02