Skip to content

Commit

Permalink
Merge branch '2.7' into 2.8
Browse files Browse the repository at this point in the history
* 2.7: (21 commits)
  [#5352] minor language tweak
  Updated text about HTTP methods
  Update http_fundamentals.rst
  [HttpKernel] Fix use statement
  [PSR-7] Fix Diactoros link
  Fixes small typo in data transformers cookbook
  some tweaks to the data transformers chapter
  Updated the Symfony Versions Roadmap image
  Fixed a minor typo
  Fixed minor issues
  Use the built-in serializer instead of promoting JMS
  Removed some information wrongly rebased
  Style / grammar fixes for the deployment chapter
  Style / grammar fixes for the controller chapter
  Style / grammar fixes for the console chapter
  Removes wrong comma
  Rewritten 'whether' & removed serial comma
  Style / grammar fixes for the configuration chapter
  Style / grammar fixes for the cache chapter
  Style / grammar fixes for the bundles chapter
  ...
  • Loading branch information
weaverryan committed Jul 12, 2015
2 parents 654b36c + 9b88c4b commit 8fadb17
Show file tree
Hide file tree
Showing 25 changed files with 118 additions and 92 deletions.
8 changes: 5 additions & 3 deletions book/http_fundamentals.rst
Expand Up @@ -96,9 +96,11 @@ delete a specific blog entry, for example:
.. note::

There are actually nine HTTP methods defined by the HTTP specification,
but many of them are not widely used or supported. In reality, many modern
browsers don't even support the ``PUT`` and ``DELETE`` methods.
There are actually nine HTTP methods (also known as verbs) defined by
the HTTP specification, but many of them are not widely used or supported.
In reality, many modern browsers only support ``POST`` and ``GET`` in
HTML forms. Various others are however supported in XMLHttpRequests,
as well as by Symfony's router.

In addition to the first line, an HTTP request invariably contains other
lines of information called request headers. The headers can supply a wide
Expand Down
2 changes: 1 addition & 1 deletion components/http_kernel/introduction.rst
Expand Up @@ -692,7 +692,7 @@ can be used to check if the current request is a "master" or "sub" request.
For example, a listener that only needs to act on the master request may
look like this::

use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
// ...

public function onKernelRequest(GetResponseEvent $event)
Expand Down
8 changes: 4 additions & 4 deletions cookbook/assetic/asset_management.rst
Expand Up @@ -91,9 +91,9 @@ To include JavaScript files, use the ``javascripts`` tag in any template:

You can also include CSS stylesheets: see :ref:`cookbook-assetic-including-css`.

In this example, all of the files in the ``Resources/public/js/`` directory
of the AppBundle will be loaded and served from a different location.
The actual rendered tag might simply look like:
In this example, all files in the ``Resources/public/js/`` directory of the
AppBundle will be loaded and served from a different location. The actual
rendered tag might simply look like:

.. code-block:: html

Expand Down Expand Up @@ -357,7 +357,7 @@ Filters
Once they're managed by Assetic, you can apply filters to your assets before
they are served. This includes filters that compress the output of your assets
for smaller file sizes (and better frontend optimization). Other filters
can compile JavaScript file from CoffeeScript files and process SASS into CSS.
can compile CoffeeScript files to JavaScript and process SASS into CSS.
In fact, Assetic has a long list of available filters.

Many of the filters do not do the work directly, but use existing third-party
Expand Down
4 changes: 2 additions & 2 deletions cookbook/assetic/jpeg_optimize.rst
Expand Up @@ -4,7 +4,7 @@
How to Use Assetic for Image Optimization with Twig Functions
=============================================================

Amongst its many filters, Assetic has four filters which can be used for on-the-fly
Among its many filters, Assetic has four filters which can be used for on-the-fly
image optimization. This allows you to get the benefits of smaller file sizes
without having to use an image editor to process each image. The results
are cached and can be dumped for production so there is no performance hit
Expand Down Expand Up @@ -70,7 +70,7 @@ It can now be used from a template:
Removing all EXIF Data
~~~~~~~~~~~~~~~~~~~~~~

By default, the ``jpegoptim`` filter removes some of the meta information stored
By default, the ``jpegoptim`` filter removes some meta information stored
in the image. To remove all EXIF data and comments, set the ``strip_all`` option
to ``true``:

Expand Down
2 changes: 1 addition & 1 deletion cookbook/assetic/yuicompressor.rst
Expand Up @@ -18,7 +18,7 @@ Download the YUI Compressor JAR
-------------------------------

The YUI Compressor is written in Java and distributed as a JAR. `Download the JAR`_
from the Yahoo! site and save it to ``app/Resources/java/yuicompressor.jar``.
from the Yahoo! website and save it to ``app/Resources/java/yuicompressor.jar``.

Configure the YUI Filters
-------------------------
Expand Down
6 changes: 3 additions & 3 deletions cookbook/bundles/configuration.rst
Expand Up @@ -210,7 +210,7 @@ The ``Configuration`` class to handle the sample configuration looks like::
supporting "prototype" nodes, advanced validation, XML-specific normalization
and advanced merging. You can read more about this in
:doc:`the Config component documentation </components/config/definition>`. You
can also see it in action by checking out some of the core Configuration
can also see it in action by checking out some core Configuration
classes, such as the one from the `FrameworkBundle Configuration`_ or the
`TwigBundle Configuration`_.

Expand All @@ -227,7 +227,7 @@ thrown)::
}

The ``processConfiguration()`` method uses the configuration tree you've defined
in the ``Configuration`` class to validate, normalize and merge all of the
in the ``Configuration`` class to validate, normalize and merge all the
configuration arrays together.

.. tip::
Expand All @@ -253,7 +253,7 @@ configuration arrays together.
}

This class uses the ``getConfiguration()`` method to get the Configuration
instance, you should override it if your Configuration class is not called
instance. You should override it if your Configuration class is not called
``Configuration`` or if it is not placed in the same namespace as the
extension.

Expand Down
4 changes: 2 additions & 2 deletions cookbook/bundles/override.rst
Expand Up @@ -90,8 +90,8 @@ In this example you fetch the service definition of the original service, and se
its class name to your own class.

See :doc:`/cookbook/service_container/compiler_passes` for information on how to use
compiler passes. If you want to do something beyond just overriding the class -
like adding a method call - you can only use the compiler pass method.
compiler passes. If you want to do something beyond just overriding the class,
like adding a method call, you can only use the compiler pass method.

Entities & Entity Mapping
-------------------------
Expand Down
2 changes: 1 addition & 1 deletion cookbook/bundles/prepend_extension.rst
Expand Up @@ -15,7 +15,7 @@ often need to be repeated for various bundles.
Using the below approach, it is possible to remove the disadvantage of the
multiple bundle approach by enabling a single Extension to prepend the settings
for any bundle. It can use the settings defined in the ``app/config/config.yml``
to prepend settings just as if they would have been written explicitly by
to prepend settings just as if they had been written explicitly by
the user in the application configuration.

For example, this could be used to configure the entity manager name to use in
Expand Down
2 changes: 1 addition & 1 deletion cookbook/bundles/remove.rst
Expand Up @@ -56,7 +56,7 @@ Remove the ``_acme_demo`` entry at the bottom of this file.

Some bundles contain configuration in one of the ``app/config/config*.yml``
files. Be sure to remove the related configuration from these files. You can
quickly spot bundle configuration by looking for a ``acme_demo`` (or whatever
quickly spot bundle configuration by looking for an ``acme_demo`` (or whatever
the name of the bundle is, e.g. ``fos_user`` for the FOSUserBundle) string in
the configuration files.

Expand Down
23 changes: 11 additions & 12 deletions cookbook/cache/varnish.rst
Expand Up @@ -29,17 +29,16 @@ in the Symfony configuration so that Varnish is seen as a trusted proxy and the
Routing and X-FORWARDED Headers
-------------------------------

If the ``X-Forwarded-Port`` header is not set correctly, Symfony will append
the port where the PHP application is running when generating absolute URLs,
e.g. ``http://example.com:8080/my/path``. To ensure that the Symfony router
generates URLs correctly with Varnish, add the correct port number in the
``X-Forwarded-Port`` header. This port depends on your setup.

Suppose that external connections come in on the default HTTP port 80. For HTTPS
connections, there is another proxy (as Varnish does not do HTTPS itself) on the
default HTTPS port 443 that handles the SSL termination and forwards the requests
as HTTP requests to Varnish with a ``X-Forwarded-Proto`` header. In this case,
add the following to your Varnish configuration:
To ensure that the Symfony Router generates URLs correctly with Varnish,
an ``X-Forwarded-Port`` header must be present for Symfony to use the
correct port number.

This port number corresponds to the port your setup is using to receive external
connections (``80`` is the default value for HTTP connections). If the application
also accepts HTTPS connections, there could be another proxy (as Varnish does
not do HTTPS itself) on the default HTTPS port 443 that handles the SSL termination
and forwards the requests as HTTP requests to Varnish with an ``X-Forwarded-Proto``
header. In this case, you need to add the following configuration snippet:

.. code-block:: varnish4
Expand Down Expand Up @@ -192,7 +191,7 @@ Symfony adds automatically:
.. tip::

If you followed the advice about ensuring a consistent caching
behavior, those vcl functions already exist. Just append the code
behavior, those VCL functions already exist. Just append the code
to the end of the function, they won't interfere with each other.

.. index::
Expand Down
2 changes: 1 addition & 1 deletion cookbook/configuration/apache_router.rst
Expand Up @@ -140,7 +140,7 @@ You're now all set to use Apache routes.
Additional Tweaks
-----------------

To save a little bit of processing time, change occurrences of ``Request``
To save some processing time, change occurrences of ``Request``
to ``ApacheRequest`` in ``web/app.php``::

// web/app.php
Expand Down
20 changes: 10 additions & 10 deletions cookbook/configuration/environments.rst
Expand Up @@ -5,13 +5,13 @@ How to Master and Create new Environments
=========================================

Every application is the combination of code and a set of configuration that
dictates how that code should function. The configuration may define the
database being used, whether or not something should be cached, or how verbose
logging should be. In Symfony, the idea of "environments" is the idea that
the same codebase can be run using multiple different configurations. For
example, the ``dev`` environment should use configuration that makes development
easy and friendly, while the ``prod`` environment should use a set of configuration
optimized for speed.
dictates how that code should function. The configuration may define the database
being used, if something should be cached or how verbose logging should be.

In Symfony, the idea of "environments" is the idea that the same codebase can be
run using multiple different configurations. For example, the ``dev`` environment
should use configuration that makes development easy and friendly, while the
``prod`` environment should use a set of configuration optimized for speed.

.. index::
single: Environments; Configuration files
Expand Down Expand Up @@ -170,10 +170,10 @@ this code and changing the environment string.

Important, but unrelated to the topic of *environments* is the ``false``
argument as the second argument to the ``AppKernel`` constructor. This
specifies whether or not the application should run in "debug mode". Regardless
specifies if the application should run in "debug mode". Regardless
of the environment, a Symfony application can be run with debug mode
set to ``true`` or ``false``. This affects many things in the application,
such as whether or not errors should be displayed or if cache files are
such as if errors should be displayed or if cache files are
dynamically rebuilt on each request. Though not a requirement, debug mode
is generally set to ``true`` for the ``dev`` and ``test`` environments
and ``false`` for the ``prod`` environment.
Expand Down Expand Up @@ -322,7 +322,7 @@ The new environment is now accessible via::
.. note::

Some environments, like the ``dev`` environment, are never meant to be
accessed on any deployed server by the general public. This is because
accessed on any deployed server by the public. This is because
certain environments, for debugging purposes, may give too much information
about the application or underlying infrastructure. To be sure these environments
aren't accessible, the front controller is usually protected from external
Expand Down
2 changes: 1 addition & 1 deletion cookbook/configuration/front_controllers_and_kernel.rst
Expand Up @@ -39,7 +39,7 @@ The main purpose of the front controller is to create an instance of the
and return the resulting response to the browser.

Because every request is routed through it, the front controller can be
used to perform global initializations prior to setting up the kernel or
used to perform global initialization prior to setting up the kernel or
to `decorate`_ the kernel with additional features. Examples include:

* Configuring the autoloader or adding additional autoloading mechanisms;
Expand Down
2 changes: 1 addition & 1 deletion cookbook/configuration/pdo_session_storage.rst
Expand Up @@ -13,7 +13,7 @@ How to Use PdoSessionHandler to Store Sessions in the Database
The default Symfony session storage writes the session information to files.
Most medium to large websites use a database to store the session values
instead of files, because databases are easier to use and scale in a
multi-webserver environment.
multi webserver environment.

Symfony has a built-in solution for database session storage called
:class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\PdoSessionHandler`.
Expand Down
2 changes: 1 addition & 1 deletion cookbook/configuration/using_parameters_in_dic.rst
Expand Up @@ -9,7 +9,7 @@ You have seen how to use configuration parameters within
There are special cases such as when you want, for instance, to use the
``%kernel.debug%`` parameter to make the services in your bundle enter
debug mode. For this case there is more work to do in order
to make the system understand the parameter value. By default
to make the system understand the parameter value. By default,
your parameter ``%kernel.debug%`` will be treated as a
simple string. Consider the following example::

Expand Down
2 changes: 1 addition & 1 deletion cookbook/console/console_command.rst
Expand Up @@ -156,7 +156,7 @@ before translating contents::
}
}

However for other services the solution might be more complex. For more details,
However, for other services the solution might be more complex. For more details,
see :doc:`/cookbook/service_container/scopes`.

Invoking other Commands
Expand Down
2 changes: 1 addition & 1 deletion cookbook/console/usage.rst
Expand Up @@ -56,7 +56,7 @@ When using the shell you can choose to run each command in a separate process:
$ php app/console -s --process-isolation
When you do this, the output will not be colorized and interactivity is not
supported so you will need to pass all command params explicitly.
supported so you will need to pass all command parameters explicitly.

.. note::

Expand Down
4 changes: 2 additions & 2 deletions cookbook/controller/service.rst
Expand Up @@ -11,11 +11,11 @@ this works fine, controllers can also be specified as services.

.. note::

Specifying a controller as a service takes a little bit more work. The
Specifying a controller as a service takes a bit more work. The
primary advantage is that the entire controller or any services passed to
the controller can be modified via the service container configuration.
This is especially useful when developing an open-source bundle or any
bundle that will be used in many different projects.
bundle that will be used in different projects.

A second advantage is that your controllers are more "sandboxed". By
looking at the constructor arguments, it's easy to see what types of things
Expand Down
22 changes: 11 additions & 11 deletions cookbook/deployment/azure-website.rst
Expand Up @@ -6,14 +6,14 @@ Deploying to Microsoft Azure Website Cloud

This step by step cookbook describes how to deploy a small Symfony web
application to the Microsoft Azure Website cloud platform. It will explain how
to setup a new Azure website including configuring the right PHP version and
to set up a new Azure website including configuring the right PHP version and
global environment variables. The document also shows how to you can leverage
Git and Composer to deploy your Symfony application to the cloud.

Setting up the Azure Website
----------------------------

To setup a new Microsoft Azure Website, first `signup with Azure`_ or sign in
To set up a new Microsoft Azure Website, first `sign up with Azure`_ or sign in
with your credentials. Once you're connected to your `Azure Portal`_ interface,
scroll down to the bottom and select the **New** panel. On this panel, click
**Web Site** and choose **Custom Create**:
Expand Down Expand Up @@ -41,7 +41,7 @@ next step.
Step 2: New MySQL Database
~~~~~~~~~~~~~~~~~~~~~~~~~~

On this step, you will be prompted to setup your MySQL database storage with a
On this step, you will be prompted to set up your MySQL database storage with a
database name and a region. The MySQL database storage is provided by Microsoft
in partnership with ClearDB. Choose the same region you selected for the hosting
plan configuration in the previous step.
Expand Down Expand Up @@ -114,7 +114,7 @@ the web server.
Choosing a more recent PHP version can greatly improve runtime performance.
PHP 5.5 ships with a new built-in PHP accelerator called OPCache that
replaces APC. On an Azure Website, OPCache is already enabled and there
is no need to install and setup APC.
is no need to install and set up APC.

The following screenshot shows the output of a :phpfunction:`phpinfo` script
run from an Azure Website to verify that PHP 5.5 is running with
Expand Down Expand Up @@ -171,7 +171,7 @@ this file just needs to be moved into the custom website extension directory.
longer be necessary.

To get the ``php_intl.dll`` file under your ``site/wwwroot`` directory, simply
access the online **Kudu** tool by browsing to the following url:
access the online **Kudu** tool by browsing to the following URL:

.. code-block:: text
Expand Down Expand Up @@ -342,7 +342,7 @@ credentials, CSRF token protection, etc. These parameters come from the
.. image:: /images/cookbook/deployment/azure-website/step-16.png
:alt: Configuring Symfony global parameters

The most important thing in this cookbook is to correctly setup your database
The most important thing in this cookbook is to correctly set up your database
settings. You can get your MySQL database settings on the right sidebar of the
**Azure Website Dashboard** panel. Simply click on the
**View Connection Strings** link to make them appear in a pop-in.
Expand Down Expand Up @@ -395,7 +395,7 @@ Symfony application is more complex than a basic Symfony Standard Edition, you
may have additional commands to execute for setup (see :doc:`/cookbook/deployment/tools`).

Make sure that your application is running by browsing the ``app.php`` front
controller with your web browser and the following url:
controller with your web browser and the following URL:

.. code-block:: bash
Expand All @@ -408,7 +408,7 @@ Configure the Web Server
~~~~~~~~~~~~~~~~~~~~~~~~

At this point, the Symfony application has been deployed and works perfectly on
the Azure Website. However, the ``web`` folder is still part of the url, which
the Azure Website. However, the ``web`` folder is still part of the URL, which
you definitely don't want. But don't worry! You can easily configure the web
server to point to the ``web`` folder and remove the ``web`` in the URL (and
guarantee that nobody can access files outside of the ``web`` directory.)
Expand Down Expand Up @@ -453,9 +453,9 @@ application, configure it with the following content:
</configuration>
As you can see, the latest rule ``RewriteRequestsToPublic`` is responsible for
rewriting any urls to the ``web/app.php`` front controller which allows you to
rewriting any URLs to the ``web/app.php`` front controller which allows you to
skip the ``web/`` folder in the URL. The first rule called ``BlockAccessToPublic``
matches all url patterns that contain the ``web/`` folder and serves a
matches all URL patterns that contain the ``web/`` folder and serves a
``403 Forbidden`` HTTP response instead. This example is based on Benjamin
Eberlei's sample you can find on GitHub in the `SymfonyAzureEdition`_ bundle.

Expand All @@ -471,7 +471,7 @@ and executed on a Microsoft IIS web server. The process is simple and easy
to implement. And as a bonus, Microsoft is continuing to reduce the number
of steps needed so that deployment becomes even easier.

.. _`signup with Azure`: https://signup.live.com/signup.aspx
.. _`sign up with Azure`: https://signup.live.com/signup.aspx
.. _`Azure Portal`: https://manage.windowsazure.com
.. _`PHP MSDN documentation`: http://blogs.msdn.com/b/silverlining/archive/2012/07/10/configuring-php-in-windows-azure-websites-with-user-ini-files.aspx
.. _`git-scm.com`: http://git-scm.com/download
Expand Down

0 comments on commit 8fadb17

Please sign in to comment.