avoo/framework-installer-bundle
Installation
composer require avoo/framework-installer-bundle
Ensure Avoo\FrameworkInstallerBundle\AvooFrameworkInstallerBundle is enabled in config/bundles.php:
return [
// ...
Avoo\FrameworkInstallerBundle\AvooFrameworkInstallerBundle::class => ['all' => true],
];
First Use Case Run the installer via CLI:
php bin/console avoo:installer:install
Follow prompts to configure your Symfony/Sylius-based project (e.g., database, admin credentials).
Key Files to Review
config/packages/avoo_framework_installer.yaml (default config)src/AvooFrameworkInstallerBundle/Resources/config/services.yaml (services)src/AvooFrameworkInstallerBundle/Command/ (CLI commands)Pre-Installation Hooks
Extend the installer by overriding the Installer service:
# config/services.yaml
services:
App\CustomInstaller:
decorates: 'avoo_framework_installer.installer'
arguments: ['@avoo_framework_installer.installer']
Implement Avoo\FrameworkInstallerBundle\Installer\InstallerInterface methods (e.g., configureDatabase()).
Post-Installation Tasks Use Symfony’s event system to trigger actions after installation:
// src/EventListener/PostInstallListener.php
namespace App\EventListener;
use Avoo\FrameworkInstallerBundle\Event\PostInstallEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class PostInstallListener implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return [
PostInstallEvent::NAME => 'onPostInstall',
];
}
public function onPostInstall(PostInstallEvent $event)
{
// Custom logic (e.g., seed data, send email)
}
}
Configuration Management
Store installer settings in config/packages/avoo_framework_installer.yaml:
avoo_framework_installer:
database_driver: 'pdo_mysql'
database_host: '127.0.0.1'
database_port: 3306
database_name: 'sylius'
database_user: 'root'
database_password: 'password'
Sylius-Specific Extensions If using Sylius, leverage its installer traits:
use Sylius\Bundle\CoreBundle\Installer\InstallerInterface as SyliusInstaller;
License Conflict
composer.json lists license: proprietary, but the repo uses MIT. Verify license compliance before use.Deprecated Symfony2
No Active Maintenance
Database Schema Assumptions
Installer service if your project diverges.Enable Verbose Mode
Run the installer with -v for detailed logs:
php bin/console avoo:installer:install -v
Check Event Dispatcher
If post-install events fail, verify the PostInstallEvent is dispatched:
// Debug in a listener
dump($event->getInstaller()->getConfig());
Override Default Config
Use config/packages/avoo_framework_installer.yaml to override defaults:
avoo_framework_installer:
skip_steps: ['create_database'] # Skip specific steps
Custom Steps
Add new installation steps by implementing StepInterface:
namespace App\Installer;
use Avoo\FrameworkInstallerBundle\Installer\StepInterface;
class CustomStep implements StepInterface
{
public function execute(): void
{
// Custom logic
}
}
Register it in services.yaml:
services:
App\Installer\CustomStep:
tags: ['avoo_framework_installer.step']
Validation Logic
Extend the Validator service to add custom checks:
use Avoo\FrameworkInstallerBundle\Validator\ValidatorInterface;
class CustomValidator implements ValidatorInterface
{
public function validate(array $config): void
{
if (!extension_loaded('pdo_mysql')) {
throw new \RuntimeException('PDO MySQL extension required.');
}
}
}
How can I help you explore Laravel packages today?