sylius-labs/polyfill-symfony-framework-bundle
PolyfillSymfonyFrameworkBundle provides a lightweight polyfill for Symfony’s FrameworkBundle, helping apps and libraries run when the full FrameworkBundle isn’t available. Useful for compatibility across Symfony versions and reduced dependencies.
Cache, HttpClient, or Messenger) in a Laravel context.symfony/dependency-injection alongside Laravel’s container).symfony/polyfill-mbstring was explicitly excluded in v1.1.1). Requires careful composer.json dependency management.Why Symfony?
HttpFoundation, Console, Cache?)Integration Scope
spatie/laravel-symfony-components) that achieve the same goal with lower risk?Long-Term Viability
Testing Requirements
HttpFoundation (e.g., for request/response handling), Console (for CLI tools), or DependencyInjection (for complex service wiring).symfony/http-kernel or symfony/flex for that.Assessment Phase:
symfony/framework-bundle in composer.json of third-party packages).Proof of Concept (PoC):
composer require sylius-labs/polyfill-symfony-framework-bundle
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class MyCommand extends Command {
protected function execute(InputInterface $input, OutputInterface $output): int {
$output->writeln('Hello from Symfony in Laravel!');
return Command::SUCCESS;
}
}
Artisan or a custom service provider.Container Bridging:
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Illuminate\Support\ServiceProvider;
class SymfonyPolyfillServiceProvider extends ServiceProvider {
public function register() {
$container = $this->app->make('symfony.container');
$container->loadFromConfig(new ContainerConfigurator(), [
// Symfony service definitions
]);
}
}
bind() to wrap Symfony services for compatibility.Incremental Rollout:
composer why-not symfony/framework-bundle to check for conflicts.composer require symfony/framework-bundle:^6.0 --with-all-dependencies and let the polyfill handle conflicts.Phase 1: Dependency Setup
composer.json.composer update --with-all-dependencies.Phase 2: Container Integration
ParameterBag, Console).Phase 3: Feature Adoption
Cache over Laravel’s cache).Phase 4: Validation
How can I help you explore Laravel packages today?