Skip to content

Commit

Permalink
reworded slightly some sentence to convert the text from a series of …
Browse files Browse the repository at this point in the history
…articles to a book
  • Loading branch information
fabpot committed May 15, 2013
1 parent ca9d5d8 commit f3c151c
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 36 deletions.
12 changes: 6 additions & 6 deletions book/part01.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ components that solve common web development problems.

Instead of using these low-level components, you can use the ready-to-be-used
Symfony2 full-stack web framework, which is based on these components... or
you can create your very own framework. This series is about the latter.
you can create your very own framework. This book is about the latter.

.. note::

Expand Down Expand Up @@ -48,16 +48,16 @@ Symfony2 Components.

.. tip::

If you don't have time to read the whole series, or if you want to get
If you don't have time to read the whole book, or if you want to get
started fast, you can also have a look at `Silex`_, a micro-framework
based on the Symfony2 Components. The code is rather slim and it leverages
many aspects of the Symfony2 Components.

Many modern web frameworks call themselves MVC frameworks. We won't talk about
MVC here as the Symfony2 Components are able to create any type of frameworks,
not just the ones that follow the MVC architecture. Anyway, if you have a look
at the MVC semantics, this series is about how to create the Controller part
of a framework. For the Model and the View, it really depends on your personal
at the MVC semantics, this book is about how to create the Controller part of
a framework. For the Model and the View, it really depends on your personal
taste and I will let you use any existing third-party libraries (Doctrine,
Propel, or plain-old PDO for the Model; PHP or Twig for the View).

Expand Down Expand Up @@ -147,8 +147,8 @@ start with the simplest web application we can think of in PHP::

printf('Hello %s', $input);

That's all for the first part of this series. Next time, we will introduce the
HttpFoundation Component and see what it brings us.
In the next chapter, we are going to introduce the HttpFoundation Component
and see what it brings us.

.. _`Symfony2`: http://symfony.com/
.. _`documentation`: http://symfony.com/doc
Expand Down
9 changes: 4 additions & 5 deletions book/part02.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ framework from scratch.
developers; the Internet has already plenty of good resources on that
topic.

Even if the "application" we wrote yesterday was simple enough, it suffers
from a few problems::
Even if the "application" we wrote in the previous chapter was simple enough,
it suffers from a few problems::

<?php

Expand Down Expand Up @@ -93,8 +93,7 @@ unit test for the above code::
At this point, if you are not convinced that security and testing are indeed
two very good reasons to stop writing code the old way and adopt a framework
instead (whatever adopting a framework means in this context), you can stop
reading this series now and go back to whatever code you were working on
before.
reading this book now and go back to whatever code you were working on before.

.. note::

Expand Down Expand Up @@ -310,7 +309,7 @@ probably work for you. Don't reinvent the wheel.
I've almost forgot to talk about one added benefit: using the HttpFoundation
component is the start of better interoperability between all frameworks and
applications using it (as of today `Symfony2`_, `Drupal 8`_, `phpBB 4`_,
`Silex`_, `Midgard CMS`_, `Zikula`_ ...).
`ezPublish 5`, `Silex`_, `Midgard CMS`_, `Zikula`_ ...).

.. _`Twig`: http://twig.sensiolabs.com/
.. _`Symfony2 versus Flat PHP`: http://symfony.com/doc/current/book/from_flat_php_to_symfony2.html
Expand Down
4 changes: 2 additions & 2 deletions book/part04.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
The Routing Component
=====================

Before we start with today's topic, let's refactor our current framework just
a little to make templates even more readable::
Before we start diving into the Routing component, let's refactor our current
framework just a little to make templates even more readable::

<?php

Expand Down
14 changes: 7 additions & 7 deletions book/part08.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Unit Testing
============

Some watchful readers pointed out some subtle but nonetheless important bugs
in the framework we have built yesterday. When creating a framework, you must
be sure that it behaves as advertised. If not, all the applications based on
it will exhibit the same bugs. The good news is that whenever you fix a bug,
you are fixing a bunch of applications too.
You might have noticed some subtle but nonetheless important bugs in the
framework we built in the previous chapter. When creating a framework, you
must be sure that it behaves as advertised. If not, all the applications based
on it will exhibit the same bugs. The good news is that whenever you fix a
bug, you are fixing a bunch of applications too.

Today's mission is to write unit tests for the framework we have created by
using `PHPUnit`_. Create a PHPUnit configuration file in
Expand Down Expand Up @@ -120,8 +120,8 @@ Executing this test is as simple as running ``phpunit`` from the
.. note::

I do not explain how the code works in details as this is not the goal of
this series, but if you don't understand what the hell is going on, I
highly recommend you to read PHPUnit documentation on `test doubles`_.
this book, but if you don't understand what the hell is going on, I highly
recommend you to read PHPUnit documentation on `test doubles`_.

After the test ran, you should see a green bar. If not, you have a bug
either in the test or in the framework code!
Expand Down
2 changes: 1 addition & 1 deletion book/part09.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ And here is the new version of ``ContentLengthListener``::
events as needed.

To make your framework truly flexible, don't hesitate to add more events; and
to make it more awesome out of the box, add more listeners. Again, this series
to make it more awesome out of the box, add more listeners. Again, this book
is not about creating a generic framework, but one that is tailored to your
needs. Stop whenever you see fit, and further evolve the code from there.

Expand Down
2 changes: 1 addition & 1 deletion book/part10.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The HttpKernel Component: HttpKernelInterface
=============================================

In the conclusion of the second part of this series, I've talked about one
In the conclusion of the second chapter of this book, I've talked about one
great benefit of using the Symfony2 components: the *interoperability* between
all frameworks and applications using them. Let's do a big step towards this
goal by making our framework implement ``HttpKernelInterface``::
Expand Down
12 changes: 6 additions & 6 deletions book/part11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ The HttpKernel Component: The HttpKernel Class
==============================================

If you were to use our framework right now, you would probably have to add
support for custom error messages. Right now, we have 404 and 500 error
support but the responses are hardcoded in the framework itself. Making them
customizable is easy enough though: dispatch a new event and listen to it.
Doing it right means that the listener has to call a regular controller. But
what if the error controller throws an exception? You will end up in an
infinite loop. There should be an easier way, right?
support for custom error messages. We do have 404 and 500 error support but
the responses are hardcoded in the framework itself. Making them customizable
is easy enough though: dispatch a new event and listen to it. Doing it right
means that the listener has to call a regular controller. But what if the
error controller throws an exception? You will end up in an infinite loop.
There should be an easier way, right?

Enter the ``HttpKernel`` class. Instead of solving the same problem over and
over again and instead of reinventing the wheel each time, the ``HttpKernel``
Expand Down
17 changes: 9 additions & 8 deletions book/part12.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
The DependencyInjection Component
=================================

In the last installment of this series, we have emptied the
``Simplex\Framework`` class by extending the ``HttpKernel`` class from
the eponymous component. Seeing this empty class, you might be tempted to move
some code from the front controller to it::
In the previous chapter, we emptied the ``Simplex\Framework`` class by
extending the ``HttpKernel`` class from the eponymous component. Seeing this
empty class, you might be tempted to move some code from the front controller
to it::

<?php

Expand Down Expand Up @@ -248,10 +248,11 @@ Don't yell at me if you don't want to have a dependency injection container in
your framework. If you don't like it, don't use it. It's your framework, not
mine.

This is (already) the last part of my series on creating a framework on top of
the Symfony2 components. I'm aware that many topics have not been covered in
great details, but hopefully it gives you enough information to get started on
your own and to better understand how the Symfony2 framework works internally.
This is (already) the last chapter of this book on creating a framework on top
of the Symfony2 components. I'm aware that many topics have not been covered
in great details, but hopefully it gives you enough information to get started
on your own and to better understand how the Symfony2 framework works
internally.

If you want to learn more, I highly recommend you to read the source code of
the `Silex`_ micro-framework, and especially its `Application`_ class.
Expand Down

0 comments on commit f3c151c

Please sign in to comment.