Micro-Kernel for PHP Applications¶
This library contains a micro-kernel for bootstrapping almost any PHP application, including Silex, Symlex (a framework stack for agile Web development based on Symfony) and Symfony Console. The kernel itself is just a few lines to set a bunch of environment parameters and create a service container instance with that.
Run an App¶
Creating a kernel instance and calling run()
is enough to start an application:
#!/usr/bin/env php <?php // Composer autoloader require_once 'vendor/autoload.php'; $app = new \DIMicroKernel\Kernel('console'); // Run the 'app' service defined in config/console.yml $app->run();
Composer¶
To use this library in your project, simply run composer require symlex/di-microkernel
or
add "symlex/di-microkernel" to your composer.json file and run composer update
:
{ "require": { "php": ">=7.1", "symlex/di-microkernel": "^2.0" } }