anujpratap/create-cscart-addon
最新稳定版本:v1.0.2
Composer 安装命令:
composer require anujpratap/create-cscart-addon
包简介
CLI tool to scaffold CS-Cart addons
README 文档
README
A PHP CLI tool to quickly scaffold a CS-Cart addon with a correct folder structure, namespaces, and boilerplate files.
No Node.js required.
Works on Windows, Linux, and macOS.
✨ Features
- 📦 Generates CS-Cart–compatible addon structure
- 🧩 PSR-4 autoloading
- 🧠 Proper namespaces based on addon name
- 🛡 Validates addon name (
letters, numbers, underscore) - ⚡ Fast CLI execution
- 🌍 Cross-platform (Windows / Linux / macOS)
📁 Generated Structure
my_addon/
├── app/
│ └── addons/
│ └── my_addon/
│ ├── controllers/
│ ├── models/
│ ├── schema/
│ ├── src/
│ │ ├── HookHandlers/
│ │ ├── Bootstrap.php
│ │ ├── Installer.php
│ │ └── ServiceProvider.php
│ └── addon.xml
├── design/
│ └── templates/
│ └── addons/
│ └── my_addon/
└── var/
└── langs/
└── addons/
📦 Installation
✅ Option 1: Install globally via Composer (recommended)
composer global require yourname/create-cscart-addon
Make sure Composer global bin is in your PATH:
# Linux / macOS export PATH="$HOME/.composer/vendor/bin:$PATH" # Windows (add manually) C:\Users\YourUser\AppData\Roaming\Composer\vendor\bin
✅ Option 2: Local usage (no global install)
php bin/create-cscart-addon my_addon
▶️ Usage
create-cscart-addon price_update
Or (Windows / local):
php create-cscart-addon.php price_update
🧪 Validation Rules
✔ Allowed
price_update
my_addon_123
❌ Not allowed
price-update
price update
price@update
🧩 Files Generated
addon.xml
- Autoload (PSR-4)
- Bootstrap
- Installer
- Active status
Bootstrap.php
- Registers service provider
- Hook handler support
Installer.php
- Install / uninstall lifecycle
- CS-Cart compliant
ServiceProvider.php
- Dependency container support (Pimple)
🖥 Platform Notes
Windows
- No
chmodrequired - Composer generates
.batautomatically
Linux / macOS
chmod +x bin/create-cscart-addon
🛠 Requirements
- PHP 8.0+
- Composer
- CS-Cart 4.x+
🗺 Roadmap
- Interactive mode
-
--forceoverwrite flag - Auto-detect CS-Cart root
- Hook handler generator
- Unit tests
- Symfony Console integration
🤝 Contributing
PRs are welcome.
- Fork the repository
- Create a feature branch
- Submit a pull request
📄 License
MIT License
⭐ Why this tool?
CS-Cart addon development lacks a standard scaffold generator. This tool brings Laravel-level developer experience (DX) to CS-Cart.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-10