symplify/symplify-kernel
This package is abandoned and no longer maintained.
The author suggests using the symfony/http-kernel package instead.
Internal Kernel for Symplify packages
Maintainers
11.1.27
2023-02-03 08:21 UTC
Requires
- php: >=8.1
- symfony/console: ^6.2
- symfony/dependency-injection: 6.1.*
- symfony/http-kernel: 6.1.*
- symplify/autowire-array-parameter: ^11.2
- symplify/package-builder: ^11.2
- symplify/smart-file-system: ^11.2
- webmozart/assert: ^1.11
Requires (Dev)
- php-parallel-lint/php-parallel-lint: ^1.3
- phpstan/extension-installer: ^1.2
- phpunit/phpunit: ^9.5.26
- rector/rector: ^0.15.10
- symplify/easy-ci: ^11.1
- symplify/easy-coding-standard: ^11.1
- symplify/phpstan-extensions: ^11.1
- tomasvotruba/unused-public: ^0.0.34
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT ecac64d984ee8fe14fbea2c41e8d25a778cb62de
This package is auto-updated.
Last update: 2023-12-03 20:33:15 UTC
README
Do you use Symfony Kernel, but not for PHP projects?
Use Symfony Kernel for:
- light Symfony Console Apps without Http
- faster and easy-to-setup tests
- merging of array parameters in 2 configs
Install
composer require symplify/symplify-kernel --dev
Usage
1. Light Kernel for Symfony CLI Apps
use Psr\Container\ContainerInterface; use Symplify\SymplifyKernel\ContainerBuilderFactory; final class MonorepoBuilderKernel { /** * @param string[] $configFiles */ public function createFromConfigs(array $configFiles): ContainerInterface { // local config here $configFiles[] = __DIR__ . '/../../config/config.php'; $containerBuilderFactory = new ContainerBuilderFactory(); $containerBuilder = $containerBuilderFactory->create($configFiles, [], []); // build the container $containerBuilder->compile(); return $containerBuilder; } }
Then use in your bin/app.php file:
$easyCIKernel = new MonorepoBuilderKernel(); $easyCIKernel->createFromConfigs([__DIR__ . '/config/config.php']); $container = $easyCIKernel->getContainer(); /** @var Application $application */ $application = $container->get(Application::class); exit($application->run());
That's it!
Report Issues
In case you are experiencing a bug or want to request a new feature head over to the Symplify monorepo issue tracker
Contribute
The sources of this package are contained in the Symplify monorepo. We welcome contributions for this package on symplify/symplify.
