Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

HTTP Foundation edits #123

Closed
wants to merge 2 commits into from

2 participants

@johnkary

Fixed some code syntax mistakes and first pass at editing for grammar and readability

@weaverryan weaverryan commented on the diff
book/http_fundamentals.rst
@@ -145,7 +145,7 @@ Symfony is architected to match this reality.
Requests and Responses in Symfony
---------------------------------
-PHP comes packaged with an array variables and methods that allow the developer
+PHP comes packaged with array variables and methods that allow the developer
@weaverryan Collaborator

I've kept this one with the old syntax - there should be an indefinite article here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@weaverryan weaverryan commented on the diff
book/http_fundamentals.rst
@@ -221,8 +221,8 @@ The Journey from the Request to the Response
We know now that the end goal of any application is to use the HTTP
request to create and return the appropriate HTTP response. Symfony provides
``Request`` and ``Response`` classes that allow this to be done through
-an object-oriented interface. Though, so far, we're only leveraging a small
-piece of Symfony, we already have the tools to write a simple application!
+an object-oriented interface. So far, we're only leveraging a small
+piece of Symfony. But we already have the tools to write a simple application!
@weaverryan Collaborator

I've taken this in, but I actually liked it better how it was before. Did it not read well before? The two new sentences are now a bit more disconnected, whereas the idea is to say that we haven't see much Symfony yet, but we already know enough to be dangerous. Thoughts?

@johnkary
johnkary added a note

Sorry for response delay, was on vacation when submitting this pull request.

I see on problem if you wanted to rejoin the sentences with a comma: "...a small piece of Symfony, but we already..." Having "Though, so far, we're only..." seemed too choppy for my taste.

Recall that a large part of the Symfony community's first language is not English, so the more straightforward and simple our writing, the easier it is to understand and translate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@weaverryan weaverryan commented on the diff
book/http_fundamentals.rst
@@ -384,7 +385,7 @@ In reality, everything we've talked about so far (the ``Request``, ``Response``,
used by Symfony. In fact, each feature in Symfony2 belongs to one of over
twenty independent libraries (called the "Symfony Components")! Even if you
decided to build your own PHP framework (an unwise idea), you could use the
-Symfony2 Components as the building blocks for many layers of functionality.
+Symfony Components as the building blocks for many layers of functionality.
@weaverryan Collaborator

Thanks - this makes it consistent with the rest of the chapter. I need to get a final word on this, but we may change everything to ultimately say "Symfony2", which is what's most commonly used throughout the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@weaverryan
Collaborator

I left some comments, but I really appreciate the help with how things "sound" (as well as catching some of my mistakes).

Thanks!

@mylen mylen referenced this pull request in symfony/symfony
Closed

[Filesystem] [mirror] added "delete" option #6014

@fabpot fabpot referenced this pull request from a commit in symfony/symfony
@fabpot fabpot merged branch mylen/master (PR #6014)
This PR was squashed before being merged into the master branch (closes #6014).

Commits
-------

2b13760 [Filesystem] [mirror] added "delete" option

Discussion
----------

[Filesystem] [mirror] added "delete" option

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets:
Todo: -
License of the code: MIT
Documentation PR: symfony/symfony-docs#123

I added a "delete" option to the mirror function. If set to true, then
files present in target dir and not in origin dir will be removed.

Added also unit test for these feature.

---------------------------------------------------------------------------

by pborreli at 2012-11-16T00:58:19Z

Symfony2 code standard use lowercase `true` and `false`

---------------------------------------------------------------------------

by mylen at 2012-11-16T20:25:19Z

I have problem to believe that the last commit (merging two if together) was to blame for the segfault on  travis...
when I run the unit testing on my machine, I get:

I'm using PHP 5.4.7 by the way...

Time: 2 seconds, Memory: 3.25Mb

OK, but incomplete or skipped tests!
Tests: 80, Assertions: 106, Skipped: 14.

---------------------------------------------------------------------------

by pborreli at 2012-11-16T20:38:40Z

Can you fix end-of-lines ?

---------------------------------------------------------------------------

by mylen at 2012-11-16T20:52:37Z

I put UNIX line feed and UTF8 charset

---------------------------------------------------------------------------

by mylen at 2012-11-16T20:53:59Z

Sorry, I add to clone the symfony repo with github and did small editing using pspad, I forgot to setup charset and line feed...
b3c58e7
@fabpot fabpot referenced this pull request from a commit in symfony/Filesystem
@fabpot fabpot merged branch mylen/master (PR #6014)
This PR was squashed before being merged into the master branch (closes #6014).

Commits
-------

2b13760 [Filesystem] [mirror] added "delete" option

Discussion
----------

[Filesystem] [mirror] added "delete" option

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets:
Todo: -
License of the code: MIT
Documentation PR: symfony/symfony-docs#123

I added a "delete" option to the mirror function. If set to true, then
files present in target dir and not in origin dir will be removed.

Added also unit test for these feature.

---------------------------------------------------------------------------

by pborreli at 2012-11-16T00:58:19Z

Symfony2 code standard use lowercase `true` and `false`

---------------------------------------------------------------------------

by mylen at 2012-11-16T20:25:19Z

I have problem to believe that the last commit (merging two if together) was to blame for the segfault on  travis...
when I run the unit testing on my machine, I get:

I'm using PHP 5.4.7 by the way...

Time: 2 seconds, Memory: 3.25Mb

OK, but incomplete or skipped tests!
Tests: 80, Assertions: 106, Skipped: 14.

---------------------------------------------------------------------------

by pborreli at 2012-11-16T20:38:40Z

Can you fix end-of-lines ?

---------------------------------------------------------------------------

by mylen at 2012-11-16T20:52:37Z

I put UNIX line feed and UTF8 charset

---------------------------------------------------------------------------

by mylen at 2012-11-16T20:53:59Z

Sorry, I add to clone the symfony repo with github and did small editing using pspad, I forgot to setup charset and line feed...
6589169
@fabpot fabpot referenced this pull request from a commit in symfony/symfony
@fabpot fabpot merged branch cloppy/Dom-Crawler-fix (PR #7127)
This PR was merged into the 2.0 branch.

Commits
-------

cb03074 [DomCrawler] lowered parsed protocol string (fixes #6986)

Discussion
----------

[DomCrawler] lowered parsed protocol string (fixes #6986)

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #6986
| License       | MIT
| Doc PR        | symfony/symfony-docs#123

Are UTs needed for this?
cf15198
@fabpot fabpot referenced this pull request from a commit in symfony/Filesystem
@fabpot fabpot merged branch mylen/master (PR #6014)
This PR was squashed before being merged into the master branch (closes #6014).

Commits
-------

2b13760 [Filesystem] [mirror] added "delete" option

Discussion
----------

[Filesystem] [mirror] added "delete" option

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets:
Todo: -
License of the code: MIT
Documentation PR: symfony/symfony-docs#123

I added a "delete" option to the mirror function. If set to true, then
files present in target dir and not in origin dir will be removed.

Added also unit test for these feature.

---------------------------------------------------------------------------

by pborreli at 2012-11-16T00:58:19Z

Symfony2 code standard use lowercase `true` and `false`

---------------------------------------------------------------------------

by mylen at 2012-11-16T20:25:19Z

I have problem to believe that the last commit (merging two if together) was to blame for the segfault on  travis...
when I run the unit testing on my machine, I get:

I'm using PHP 5.4.7 by the way...

Time: 2 seconds, Memory: 3.25Mb

OK, but incomplete or skipped tests!
Tests: 80, Assertions: 106, Skipped: 14.

---------------------------------------------------------------------------

by pborreli at 2012-11-16T20:38:40Z

Can you fix end-of-lines ?

---------------------------------------------------------------------------

by mylen at 2012-11-16T20:52:37Z

I put UNIX line feed and UTF8 charset

---------------------------------------------------------------------------

by mylen at 2012-11-16T20:53:59Z

Sorry, I add to clone the symfony repo with github and did small editing using pspad, I forgot to setup charset and line feed...
0a3b362
@mmucklo mmucklo referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@mmucklo mmucklo referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 13 deletions.
  1. +14 −13 book/http_fundamentals.rst
View
27 book/http_fundamentals.rst
@@ -145,7 +145,7 @@ Symfony is architected to match this reality.
Requests and Responses in Symfony
---------------------------------
-PHP comes packaged with an array variables and methods that allow the developer
+PHP comes packaged with array variables and methods that allow the developer
@weaverryan Collaborator

I've kept this one with the old syntax - there should be an indefinite article here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
to understand each request and send a response. For request information,
PHP prepares superglobal variables such as ``$_SERVER`` and ``$_GET``.
Recall that each raw request is simply an HTTP-formatted block of text.
@@ -193,7 +193,7 @@ to the client::
use Symfony\Component\HttpFoundation\Response;
$response = new Response();
- $response->setContent('<html><body><h1>Hello world!</h1></body></html');
+ $response->setContent('<html><body><h1>Hello world!</h1></body></html>');
$response->setStatusCode(200);
$response->headers->set('Content-Type', 'text/html');
@@ -221,8 +221,8 @@ The Journey from the Request to the Response
We know now that the end goal of any application is to use the HTTP
request to create and return the appropriate HTTP response. Symfony provides
``Request`` and ``Response`` classes that allow this to be done through
-an object-oriented interface. Though, so far, we're only leveraging a small
-piece of Symfony, we already have the tools to write a simple application!
+an object-oriented interface. So far, we're only leveraging a small
+piece of Symfony. But we already have the tools to write a simple application!
@weaverryan Collaborator

I've taken this in, but I actually liked it better how it was before. Did it not read well before? The two new sentences are now a bit more disconnected, whereas the idea is to say that we haven't see much Symfony yet, but we already know enough to be dangerous. Thoughts?

@johnkary
johnkary added a note

Sorry for response delay, was on vacation when submitting this pull request.

I see on problem if you wanted to rejoin the sentences with a comma: "...a small piece of Symfony, but we already..." Having "Though, so far, we're only..." seemed too choppy for my taste.

Recall that a large part of the Symfony community's first language is not English, so the more straightforward and simple our writing, the easier it is to understand and translate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Let's dive in:
.. code-block:: php
@@ -241,14 +241,14 @@ Let's dive in:
$response->send();
In this simple example, the application correctly processes the request and
-returns an appropriate response. From a very technical standpoint, then, our
+returns an appropriate response. From a very technical standpoint, our
application does exactly what it should.
An Application without a Framework
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
But what if the application needs to grow? Imagine this same application if it
-were forced now to handle hundreds or even thousands of different pages! In
+were now forced to handle hundreds or even thousands of different pages! In
order to keep things maintainable (i.e. not all in one file), we'd need to do
some reorganization. For starters, we might move the work of creating the
``Response`` into a set of different functions. These functions are commonly
@@ -280,7 +280,8 @@ known as *controllers* and allow us to further organize our code::
Next, our growing application still contains a long ``if`` ``elseif`` block
that routes the creation of the ``Response`` object to a different controller
(i.e. PHP method). We might consider building a configuration-based routing
-system that maps each request (by URI and HTTP method) to a specific controller.
+system that maps each request to a specific controller based on the URI and
+HTTP method of the request.
Obvious or not, the application is beginning to spin out of control. Recall
that the goal of any application is to apply the custom application logic and
@@ -309,15 +310,15 @@ for use.
Introducing the Symfony Kernel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Symfony is based around a ``Kernel`` object whose only job is to facilitate
+Symfony is based around a ``Kernel`` object whose single responsibility is to facilitate
the journey from the ``Request`` object to the final ``Response`` object.
The ``Kernel`` is what handles each request and actually executes your application
code.
-The "application code" that's executed by the ``Kernel`` is called a "controller",
+The "application code" executed by the ``Kernel`` is called a "controller",
a special term for what's actually a basic PHP callable (most commonly,
an object method). The controller is where your application code lives -
-it's where you create the final ``Response`` object. The Kernel works by
+it's where you create the final ``Response`` object. The ``Kernel`` works by
determining and then calling a "Controller" for each request:
.. code-block:: text
@@ -338,7 +339,7 @@ elsewhere and handled by the ``Kernel``::
public function aboutAction()
{
- return Response('About us');
+ return new Response('About us');
}
}
@@ -384,7 +385,7 @@ In reality, everything we've talked about so far (the ``Request``, ``Response``,
used by Symfony. In fact, each feature in Symfony2 belongs to one of over
twenty independent libraries (called the "Symfony Components")! Even if you
decided to build your own PHP framework (an unwise idea), you could use the
-Symfony2 Components as the building blocks for many layers of functionality.
+Symfony Components as the building blocks for many layers of functionality.
@weaverryan Collaborator

Thanks - this makes it consistent with the rest of the chapter. I need to get a final word on this, but we may change everything to ultimately say "Symfony2", which is what's most commonly used throughout the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
And if you do use Symfony2, but need to replace a component entirely, you have
the ability to do that. Symfony2 is decoupled and relies on interface-driven
dependency injection. In other words, the developer has complete control.
@@ -395,7 +396,7 @@ a PHP framework that accomplishes two distinct tasks:
#. Provides a selection of components (i.e. the Symfony2 Components) and
third-party libraries.
-#. Provides sensible configuration that ties everything together nicely.
+#. Provides sensible configuration that nicely ties everything together.
The goal of the framework is to integrate many independent tools in order
to provide a consistent experience for the developer. Even the framework
Something went wrong with that request. Please try again.