PHPackages                             bangpound/drupal-kernel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. bangpound/drupal-kernel

ActiveLibrary[Framework](/categories/framework)

bangpound/drupal-kernel
=======================

Symfony HTTP kernel wrapper around Drupal 7

314PHP

Since Oct 10Pushed 12y ago2 watchersCompare

[ Source](https://github.com/bangpound/drupal-kernel)[ Packagist](https://packagist.org/packages/bangpound/drupal-kernel)[ RSS](/packages/bangpound-drupal-kernel/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Drupal Kernel
=============

[](#drupal-kernel)

These two experimental classes wrap Drupal 7 in a Symfony HTTP kernel.

The kernel serializes the Symfony request object in customized front controller for Drupal. The front controller runs in an isolated PHP process. It requires the Composer autoloader so that it can access Symfony classes.

Before Drupal is bootstrapped, the injected request is unserialized and those values replace the globals in the Drupal process. The Drupal process is bootstrapped and the Drupal request is handled and the response is echoed as PHP CGI output.

The kernel which opened the process captures the output, parses the headers and returns a Symfony response object.

Inspiration, code and fair warning are taken from Igor Wiedler's [CgiHttpKernel](https://github.com/igorw/CgiHttpKernel) and [The HttpKernelInterface is a lie](https://speakerdeck.com/igorw/the-httpkernelinterface-is-a-lie-london).

This is not a way to run Drupal.

Usage
-----

[](#usage)

Just add `bangpound/drupal-kernel` to your `composer.json` file.

```
{
    "require": {
        "bangpound/drupal-kernel": "dev-master"
    }
}
```

Then create a front controller named index.php with this code in it:

```
