A powerful command-line tool for generating SixShop extension boilerplate code, designed to streamline the development process within the SixShop ecosystem.
# Install as development dependency
composer require six-shop/maker-bundle --dev
# Or install globally
composer global require six-shop/maker-bundle
# Clone the repository
git clone https://github.com/sixshop/maker-bundle.git
cd maker-bundle
# Install dependencies
composer install
# If installed locally
php vendor/bin/sixshop-maker
# If installed globally
sixshop-maker
# Or directly
php bin/sixshop-maker
The tool guides you through a step-by-step process:
$ php vendor/bin/sixshop-maker
请输入扩展生成的目标路径 [/current/path]: ./my-extension
将在以下路径生成扩展: /full/path/to/my-extension
确认使用此路径? [yes]
请输入Composer包名 (例如: six-shop/hello): my-vendor/awesome-extension
请输入包描述 [A SixShop extension package]: My awesome SixShop extension
请输入命名空间 (例如: SixShop\Hello\) [MyVendor\AwesomeExtension\]:
请输入扩展ID [my-vendor-awesome-extension]:
✅ 扩展创建完成!
The tool creates a complete extension structure:
my-extension/
├── composer.json # Package configuration
├── .gitignore # Git ignore rules
├── src/
│ └── Extension.php # Main extension class
├── route/
│ ├── api.php # API routes
│ └── admin.php # Admin routes
├── config.php # Extension configuration
└── info.php # Extension metadata
The tool automatically detects existing composer.json files and offers:
All generated files use PHP templates located in /templates/:
composer.json.tpl.php - Package configurationsrc/Extension.php.tpl.php - Main extension class.gitignore.tpl.php - Git ignore rulesroute/api.php.tpl.php - API routesroute/admin.php.tpl.php - Admin routesconfig.php.tpl.php - Configuration fileinfo.php.tpl.php - Metadata fileTemplates have access to these variables:
$name - Package name (e.g., "vendor/package")$namespace - PHP namespace (e.g., "Vendor\Package\")$id - Extension ID (e.g., "vendor-package")$description - Package descriptionMaker - Main command controller and user interactionComposerGenerator - Handles composer.json generation and detectionDirectoryGenerator - Creates directory structureGitignoreGenerator - Generates .gitignore filesPhpCodeGenerator - Creates PHP source files from templates# Start the maker
php vendor/bin/sixshop-maker
# Follow prompts
Target Path: ./my-new-extension
Package Name: sixshop/payment-gateway
Namespace: SixShop\PaymentGateway\
Extension ID: sixshop-payment-gateway
# Result: Complete extension ready for development
# Run in directory with existing composer.json
php vendor/bin/sixshop-maker
# Tool detects existing configuration
Found existing composer.json: ./composer.json
Package: sixshop/payment-gateway
Namespace: SixShop\PaymentGateway\
# Confirm regeneration
Use existing configuration? [yes]
# Files updated with current templates
Permission Errors
Error: Target path not writable
Solution: Ensure write permissions on target directory
Missing Dependencies
Error: Composer autoload not found
Solution: Run composer install first
Invalid Package Names
Error: Package name format incorrect
Solution: Use format "vendor/package" with lowercase and hyphens
For verbose output, use PHP's built-in debugging:
# Enable error reporting
php -d display_errors=1 vendor/bin/sixshop-maker
We welcome contributions! Please see our contributing guidelines:
# Clone and setup
git clone https://github.com/sixshop/maker-bundle.git
cd maker-bundle
composer install
# Run the tool locally
php bin/sixshop-maker
This project is licensed under the MIT License. See the LICENSE file for details.
Made with ❤️ for the SixShop community