@@ -8,19 +8,14 @@ Instead of using these low-level components, you can use the ready-to-be-used
88Symfony2 full-stack web framework, which is based on these components... or
99you can create your very own framework. This book is about the latter.
1010
11- .. note ::
12-
13- If you just want to use the Symfony2 full-stack framework, you'd better
14- read its official `documentation `_ instead.
15-
1611Why would you like to create your own framework?
1712------------------------------------------------
1813
1914Why would you like to create your own framework in the first place? If you
2015look around, everybody will tell you that it's a bad thing to reinvent the
2116wheel and that you'd better choose an existing framework and forget about
22- creating your own altogether. Most of the time, they are right but I can think
23- of a few good reasons to start creating your own framework:
17+ creating your own altogether. Most of the time, they are right but there are
18+ a few good reasons to start creating your own framework:
2419
2520* To learn more about the low level architecture of modern web frameworks in
2621 general and about the Symfony2 full-stack framework internals in particular;
@@ -37,11 +32,11 @@ of a few good reasons to start creating your own framework:
3732* To prove the world that you can actually create a framework on your own (...
3833 but with little effort).
3934
40- I will gently guide you through the creation of a web framework, one step at a
41- time. At each step, you will have a fully-working framework that you can use
42- as is or as a start for your very own. We will start with simple frameworks
43- and more features will be added with time. Eventually, you will have a
44- fully-featured full-stack web framework.
35+ This tutorial will gently guide you through the creation of a web framework,
36+ one step at a time. At each step, you will have a fully-working framework that
37+ you can use as is or as a start for your very own. We will start with simple
38+ frameworks and more features will be added with time. Eventually, you will have
39+ a fully-featured full-stack web framework.
4540
4641And of course, each step will be the occasion to learn more about some of the
4742Symfony2 Components.
@@ -58,16 +53,16 @@ won't talk about the MVC pattern as the Symfony2 Components are able to create
5853any type of frameworks, not just the ones that follow the MVC architecture.
5954Anyway, if you have a look at the MVC semantics, this book is about how to
6055create the Controller part of a framework. For the Model and the View, it
61- really depends on your personal taste and I will let you use any existing
56+ really depends on your personal taste and you can use any existing
6257third-party libraries (Doctrine, Propel, or plain-old PDO for the Model; PHP
6358or Twig for the View).
6459
65- When creating a framework, following the MVC pattern is not the right goal.
66- The main goal should be the **Separation of Concerns **; I actually think that
67- this is the only design pattern that you should really care about. The
68- fundamental principles of the Symfony2 Components are focused on the HTTP
69- specification. As such, the frameworks that we are going to create should be
70- more accurately labelled as HTTP frameworks or Request/Response frameworks.
60+ When creating a framework, following the MVC pattern is not the right goal. The
61+ main goal should be the **Separation of Concerns **; this is probably the only
62+ design pattern that you should really care about. The fundamental principles of
63+ the Symfony2 Components are focused on the HTTP specification. As such, the
64+ frameworks that we are going to create should be more accurately labelled as
65+ HTTP frameworks or Request/Response frameworks.
7166
7267Before we start
7368---------------
@@ -89,7 +84,7 @@ classes, how we will reference external dependencies, etc.
8984
9085To store our framework, create a directory somewhere on your machine:
9186
92- .. code-block :: sh
87+ .. code-block :: bash
9388
9489 $ mkdir framework
9590 $ cd framework
@@ -101,16 +96,16 @@ To install the Symfony2 Components that we need for our framework, we are going
10196to use `Composer `_, a project dependency manager for PHP. If you don't have it
10297yet, `download and install `_ Composer now:
10398
104- .. code-block :: sh
99+ .. code-block :: bash
105100
106101 $ curl -sS https://getcomposer.org/installer | php
107102
108103 Then, generate an empty ``composer.json `` file, where Composer will store the
109104framework dependencies:
110105
111- .. code-block :: sh
106+ .. code-block :: bash
112107
113- $ php composer.phar init -n
108+ $ composer init -n
114109
115110 Our Project
116111-----------
@@ -130,7 +125,7 @@ start with the simplest web application we can think of in PHP::
130125Use the PHP built-in server to test this great application in a browser
131126(``http://localhost:4321/index.php?name=Fabien ``):
132127
133- .. code-block :: sh
128+ .. code-block :: bash
134129
135130 $ php -S 127.0.0.1:4321
136131
0 commit comments