Skip to content

Commit c569ae5

Browse files
author
Benjamin Doherty
committed
readme.
1 parent 0aae83e commit c569ae5

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

README.md

+51-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,53 @@
1-
Symfony Routes
1+
Symfony Kernel
22
==============
33

4+
Embed a Symfony Kernel in your Drupal application. When a site visitor requests a Symfony
5+
route, the kernel handles the request inside a Drupal page callback.
6+
7+
Normal page delivery can be short circuited entirely so that the Symfony response
8+
is always sent, but the normal arrangement is that HTML responses are embedded inside
9+
Drupal pages as the `$content` variable in `page.tpl.php`. Non-HTML responses are sent
10+
directly to the user.
11+
12+
Usage
13+
-----
14+
Implement `hook_kernel_info()` and name your Symfony kernel `app` (only one is supported).
15+
16+
The kernel class must be autoloadable (unlike in Symfony's front controllers which include
17+
it). Put it in a module's info file.
18+
19+
```ini
20+
name = My awesome Symfony application
21+
core = 7.x
22+
dependencies[] = kernel
23+
files[] = app/AppKernel.php
24+
```
25+
26+
The `app` and `src` directories in this module are a starting point for your own project.
27+
28+
Use `drush app` to use your Symfony kernel's console commands.
29+
30+
To do
31+
-----
32+
* Synchronize kernel events with Drupal bootstrap. See
33+
<https://github.com/bangpound/drupal-bundle/blob/master/EventListener/BootstrapListener.php>
34+
* Cooperate with Drupal's session handler. See
35+
<https://github.com/bangpound/drupal-bundle/blob/master/DrupalSessionHandler.php>
36+
* Expose Drupal users to Symfony with a UserProvider. See
37+
<https://github.com/bangpound/drupal-bundle/blob/master/Security/User/UserProvider.php>
38+
* Support multiple kernels with [LazyHttpKernel](https://github.com/stackphp/LazyHttpKernel)
39+
and [UrlMap](https://github.com/stackphp/url-map).
40+
41+
Known issues
42+
------------
43+
* Symfony web profiler should be disabled in your kernel. It cannot offer an accurate
44+
picture of your requests and responses anyway!
45+
* Assetic is hard to use. You can't use the Assetic controller, but you can dump assets
46+
and use them from Drupal. Documentation forthcoming.
47+
48+
Screenshots
49+
-----------
50+
51+
![Drupal running the Symfony Acme Demo bundle](http://bangpound.org/kernel/drupal.png)
52+
53+
![Output of `drush app`](http://bangpound.org/kernel/drush.png)

0 commit comments

Comments
 (0)