Skip to content


Our light-weight kernel can bootstrap almost any PHP application. It is based on our DIMicroKernel library. The kernel itself is just a few lines to set environment parameters, initialize the Symfony service container and then start the app by calling run().


YAML files located in config/ configure the application and all of it's dependencies as a service. The filename matches the application's environment name (e.g. config/console.yml). The configuration can additionally be modified for sub environments such as local or production by providing a matching config file like config/console.local.yml (see app.sub_environment parameter). These files are in the same well documented format you might know from Symfony:

parameters: 'My App'
    app.version: '1.0'

        class: Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand

        class: Symfony\Component\Console\Application
        arguments: [, %app.version%]
        public: true
            - [ add, [ "@doctrine.migrations.migrate" ] ]

This provides a uniform approach for bootstrapping Web applications such as Symlex\Application\Web or command-line applications like Symfony\Component\Console\Application (wrapped in Symlex\Application\Console) using the same kernel. The result is much cleaner and leaner than the usual bootstrap and configuration madness you know from many frameworks.

Disable Caching

If debug mode is turned off, the service container configuration is cached by the kernel in the directory set as cache path. You have to delete all cache files after updating the configuration. To disable caching completely, add container.cache: false to your config parameters:

    container.cache: false

Run multiple kernels via Symlex\Kernel\WebApps


This is an experimental proof-of-concept. Feedback welcome.

As an alternative to Symfony bundles, Symlex\Kernel\WebApps is capable of running multiple apps based on Symlex\Kernel\App on the same Symlex installation:

$app = new WebApps('web', __DIR__ . '/../app', false);

It's bootstrapped like a regular WebApp and subsequently bootstaps other Symlex apps according to the configuration in app/config/web.guests.yml (path, debug, prefix and domain are optional; bootstrap and config are required):

    prefix: /example
    bootstrap: \Symlex\Kernel\WebApp
    config: web.yml
    debug: true
    path: vendors/foo/bar/app

    bootstrap: \Symlex\Kernel\WebApp
    config: web.default.yml


Assets in web/ like images, CSS or JavaScript in are not automatically shared in a way Assetic does this with Symfony bundles. If your apps not only provide Web services, you might have to create symbolic links or modify your HTML templates.


HTTP interceptors can be used to perform HTTP authentication or other actions (e.g. blocking certain IP ranges) before routing a request:


use Symlex\Kernel\App;

class WebApp extends App
    public function __construct($appPath, $debug = false)
        parent::__construct('web', $appPath, $debug);

    public function boot () {

        $container = $this->getContainer();

         * In app/config/web.yml:
         * services:
         *     http.interceptor:
         *         class: Symlex\Router\HttpInterceptor
        $interceptor = $container->get('http.interceptor');
            array('foouser' => 'somepassword')


            ->route('/api', '');

            ->route('', 'controller.web.');