contao-components/installer
Custom Composer installer for Contao components. Installs packages of type "contao-component" into a dedicated directory (e.g., assets) configured via composer.json extra "contao-component-dir".
contao-components/installer is exclusively designed for Contao CMS, leveraging its proprietary contao-component package type and directory structure (contao-component-dir). Laravel’s architecture—rooted in PSR-4 autoloading, vendor/ directory conventions, and framework-specific service containers—fundamentally conflicts with this package’s assumptions. Key misalignments:
vendor/, while this package installs components to a custom path (e.g., assets/), requiring manual autoload overrides.TL_ROOT, Database::getInstance()), which Laravel’s strict dependency injection and service providers cannot resolve without heavy customization.ServiceProvider and event systems are incompatible with Contao’s hook-based architecture, necessitating a custom abstraction layer for integration.composer/installers, or manual files autoloading). The 50.44 "opportunity" score suggests niche use cases (e.g., hybrid Contao/Laravel apps), but these are edge cases in the PHP ecosystem.vendor/ installation path via extra.contao-component-dir and manually mapping namespaces in autoload.psr-4.composer dump-autoload --optimize or symlinks to bridge the custom directory with Laravel’s ClassLoader.Input::get()) and Laravel’s DI container (e.g., request()->input()).doctrine/dbal) may clash with Laravel’s versions.TL_* classes) may conflict with Laravel’s autoloading precedence.ClassLoader will not natively recognize the custom contao-component-dir. Workarounds (e.g., files autoloading) introduce:
composer install.autoload config when components are added/removed.$GLOBALS['TL_CONFIG']) will break in Laravel without wrappers.Call to undefined function TL_*).contao/core-bundle).TL_* with Laravel services)?spatie/laravel-contao) that avoids this installer?ServiceProvider, Facade, or Console command support.contao/core-bundle).plugins/ but not tightly coupled).composer require vendor/package with PSR-4 autoloading.symfony/flex-recipe).composer/installers to support contao-component types in vendor/.laravel/new + contao-components/installer).composer.json:
"extra": {
"contao-component-dir": "plugins"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Contao\\": "plugins/" // Map Contao namespace
},
"files": ["plugins/vendor/autoload.php"] // Fallback
}
composer dump-autoload --optimize.Input::get() → request()->input()).contao_init → Events::dispatch('contao.init')).// app/Providers/ContaoServiceProvider.php
public function register() {
$this->app->singleton('contao.input', function () {
return new class {
public function get($key) {
return request()->input($key);
}
};
});
}
tl_settings)..env variables via Laravel’s .env or config/contao.php.| Aspect | Compatibility | Workaround |
|---|---|---|
| Composer | ✅ Works as custom installer | Manual autoload config required |
| Autoloading | ❌ Fails without PSR-4 mapping | Add psr-4 or files to composer.json |
| Dependency Resolution | ⚠️ Risks conflicts (e.g., doctrine/dbal) |
Use composer why-not to diagnose |
| Framework Integration | ❌ No Laravel hooks/events | Custom ServiceProvider mediation |
| Database | ❌ Contao schema vs. Laravel migrations | Sync via Laravel migrations or Artisan commands |
| Routing | ❌ Contao’s PageRegular vs. Laravel routes |
Use middleware to proxy requests |
composer dump-autoload).new \Contao\Component\ClassName()).How can I help you explore Laravel packages today?