anujpratap/create-cscart-addon 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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 chmod required
  • Composer generates .bat automatically

Linux / macOS

chmod +x bin/create-cscart-addon

🛠 Requirements

  • PHP 8.0+
  • Composer
  • CS-Cart 4.x+

🗺 Roadmap

  • Interactive mode
  • --force overwrite flag
  • Auto-detect CS-Cart root
  • Hook handler generator
  • Unit tests
  • Symfony Console integration

🤝 Contributing

PRs are welcome.

  1. Fork the repository
  2. Create a feature branch
  3. 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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固