Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Installer Laravel Package

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".

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Misaligned Ecosystems: The 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:
    • Namespace Isolation: Laravel expects dependencies in vendor/, while this package installs components to a custom path (e.g., assets/), requiring manual autoload overrides.
    • Framework Integration: Contao components may rely on Contao-specific globals (e.g., TL_ROOT, Database::getInstance()), which Laravel’s strict dependency injection and service providers cannot resolve without heavy customization.
    • Event/Service Binding: Laravel’s ServiceProvider and event systems are incompatible with Contao’s hook-based architecture, necessitating a custom abstraction layer for integration.
  • Opportunity Cost: For Laravel projects, this package offers no inherent advantage over existing solutions (e.g., Laravel Packages, 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.

Integration Feasibility

  • High Friction: Integrating this package into Laravel would require:
    1. Custom Composer Configuration: Overriding Laravel’s default vendor/ installation path via extra.contao-component-dir and manually mapping namespaces in autoload.psr-4.
    2. Autoloading Hacks: Using composer dump-autoload --optimize or symlinks to bridge the custom directory with Laravel’s ClassLoader.
    3. Framework Mediation: Writing adapters to translate between Contao’s globals (e.g., Input::get()) and Laravel’s DI container (e.g., request()->input()).
  • Dependency Risks: Contao components may introduce:
    • Version Conflicts: Contao’s PHP dependencies (e.g., doctrine/dbal) may clash with Laravel’s versions.
    • License Incompatibility: LGPL-3.0 Contao components could restrict Laravel’s MIT-licensed codebase if dynamically linked (e.g., via shared libraries).
    • Runtime Collisions: Contao’s magic methods (e.g., TL_* classes) may conflict with Laravel’s autoloading precedence.

Technical Risk

  • Autoloading Failures: Laravel’s ClassLoader will not natively recognize the custom contao-component-dir. Workarounds (e.g., files autoloading) introduce:
    • Performance Overhead: Scanning custom directories slows composer install.
    • Maintenance Burden: Manual updates to autoload config when components are added/removed.
  • Runtime Errors: Contao components relying on global state (e.g., $GLOBALS['TL_CONFIG']) will break in Laravel without wrappers.
  • Debugging Nightmares: Stack traces will obscure the source of Contao-specific errors (e.g., Call to undefined function TL_*).
  • CI/CD Instability: Automated tests may fail due to environment-specific paths or missing Contao dependencies (e.g., contao/core-bundle).

Key Questions

  1. Strategic Alignment:
    • Why use Contao components in a Laravel project? Is this for legacy migration, hybrid architecture, or specific Contao features (e.g., DCA-driven admin panels)?
  2. Technical Feasibility:
    • Can Contao components be refactored to use Laravel’s DI container (e.g., replace TL_* with Laravel services)?
    • Will the performance overhead of custom autoloading justify the benefits?
  3. Long-Term Viability:
    • How will future Laravel updates (e.g., PHP 8.2+, Symfony 7) interact with Contao’s legacy dependencies?
    • Is the team prepared to maintain a custom integration layer indefinitely?
  4. Alternatives:
    • Could the same goals be achieved with Laravel Packages or Symfony Bundles (e.g., for modularity)?
    • Is there a Contao-compatible Laravel wrapper (e.g., spatie/laravel-contao) that avoids this installer?
  5. Compliance:
    • How will LGPL-3.0 obligations (e.g., source availability) be managed in a Laravel project under MIT?

Integration Approach

Stack Fit

  • Poor Fit for Laravel: This package is not designed for Laravel and lacks:
    • Framework-Agnostic Design: Assumes Contao’s global state, database schema, and routing.
    • Laravel Integration Points: No ServiceProvider, Facade, or Console command support.
    • PSR Compliance: Violates PSR-4 by installing to a non-standard path.
  • Potential Niche Use Cases:
    • Hybrid Contao/Laravel Apps: Where Contao handles frontend CMS and Laravel powers the backend API (e.g., via contao/core-bundle).
    • Legacy Plugin Migration: Reusing existing Contao plugins in a Laravel project (e.g., for admin panels).
    • Custom Plugin Architecture: Treating Contao components as Laravel "plugins" (e.g., installed in plugins/ but not tightly coupled).
  • Better Alternatives:
    • Laravel Packages: Use composer require vendor/package with PSR-4 autoloading.
    • Symfony Flex: For modular Symfony/Laravel apps (e.g., symfony/flex-recipe).
    • Custom Installer: Extend composer/installers to support contao-component types in vendor/.

Migration Path

  1. Assess Compatibility:
    • Audit target Contao components for Laravel incompatibilities (e.g., globals, static calls).
    • Test with a minimal Laravel project (e.g., laravel/new + contao-components/installer).
  2. Configure Autoloading:
    • Add to composer.json:
      "extra": {
        "contao-component-dir": "plugins"
      },
      "autoload": {
        "psr-4": {
          "App\\": "app/",
          "Contao\\": "plugins/"  // Map Contao namespace
        },
        "files": ["plugins/vendor/autoload.php"]  // Fallback
      }
      
    • Run composer dump-autoload --optimize.
  3. Framework Mediation:
    • Create a Laravel ServiceProvider to:
      • Bind Contao globals to Laravel’s container (e.g., Input::get()request()->input()).
      • Register Contao hooks as Laravel events (e.g., contao_initEvents::dispatch('contao.init')).
    • Example:
      // app/Providers/ContaoServiceProvider.php
      public function register() {
          $this->app->singleton('contao.input', function () {
              return new class {
                  public function get($key) {
                      return request()->input($key);
                  }
              };
          });
      }
      
  4. Database/Environment Sync:
    • Use Laravel migrations to seed Contao tables (e.g., tl_settings).
    • Expose Contao’s .env variables via Laravel’s .env or config/contao.php.

Compatibility

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

Sequencing

  1. Phase 0: Feasibility Study
    • Install the package in a blank Laravel project and verify:
      • Autoloading (composer dump-autoload).
      • Basic Contao component functionality (e.g., new \Contao\Component\ClassName()).
    • Document blockers (e.g., "
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky