-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathindex.html
More file actions
107 lines (95 loc) · 3.61 KB
/
index.html
File metadata and controls
107 lines (95 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
layout: default
nav_name: home
---
{% block full_title %}{{ site.title }} — {{ site.subtitle }}{% endblock %}
{% block content %}
<hr>
<div class="about text">
<h2>A common layer</h2>
<p>
What do we want? Re-use at the web layer!
</p>
<p>
Superglobals and side-effecting output mechanisms of PHP make this challenging and force every framework to re-invent.
</p>
<p>
But Symfony's HttpKernelInterface provides a solid abstraction, which makes creating and sharing framework-agnostic HTTP filters a breeze!
</p>
</div>
<hr>
<div class="about text">
<h2>HttpKernel</h2>
<p>
The <a href="https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/HttpKernelInterface.php">HttpKernelInterface</a> models web request and response as PHP objects, giving them value semantics.
</p>
<figure>
<img src="{{ site.url }}/img/kernel.png" alt="HttpKernel">
</figure>
</div>
<hr>
<div class="about text">
<h2>What is Stack?</h2>
<p>
Stack is a convention for composing HttpKernelInterface middlewares.
</p>
<figure>
<img src="{{ site.url }}/img/onion.png" alt="Kernel Onion">
</figure>
<p>
By wrapping your application in decorators you can add new behaviour from the outside.
</p>
</div>
<hr>
<div class="frameworks">
<h2 class="text-center">Supported frameworks</h2>
{% spaceless %}
<ul class="frameworks-logo-list clearfix">
<li><a href="http://symfony.com/"><img src="{{site.url}}/img/users/symfony.png" alt="Symfony 2" /></a></li>
<li><a href="http://silex.sensiolabs.org/"><img src="{{site.url}}/img/users/silex.png" alt="Silex" /></a></li>
<li><a href="http://laravel.com/"><img src="{{site.url}}/img/users/laravel.png" alt="Laravel 4" /></a></li>
<li><a href="https://drupal.org/"><img src="{{site.url}}/img/users/drupal.png" alt="Drupal8" /></a></li>
<li><a href="http://ez.no/"><img src="{{site.url}}/img/users/ez-publish.png" alt="eZ Publish 5" /></a></li>
<li><a href="http://yolophp.com/"><img src="{{site.url}}/img/users/yolo.png" alt="Yolo" /></a></li>
</ul>
{% endspaceless %}
</div>
<hr>
<div class="middleware text">
<h2>Conventions</h2>
<p>
A stack middleware is just an object that follows these <strong>conventions</strong>:
</p>
<ol class="conventions inline clearfix">
<li class="span4 clearfix"><div class="no">1</div> Implement the <strong>HttpKernelInterface</strong></li>
<li class="span4 clearfix"><div class="no">2</div> Take the <strong>decorated app</strong> as the first constructor argument</li>
<li class="span4 clearfix"><div class="no">3</div> Decorate the handle call, <strong>delegate</strong> to the decorated app</li>
</ol>
<p>
Yes, leveraging the HTTP abstraction is that easy!
</p>
</div>
{% endblock %}
{% block footer %}
<p class="lead">Brought to you by</p>
<ul class="avatars">
<li>
<a href="https://twitter.com/igorwesome">
<img class="img-circle" src="{{ site.url }}/img/igorwesome.jpeg">
@igorwesome
</a>
</li>
<li>
<a href="https://twitter.com/beausimensen">
<img class="img-circle" src="{{ site.url }}/img/beausimensen.png">
@beausimensen
</a>
</li>
<li>
<a href="https://twitter.com/hochchristoph">
<img class="img-circle" src="{{ site.url }}/img/hochchristoph.jpg">
@hochchristoph
</a>
</li>
</ul>
{% endblock %}