Skip to content

Commit

Permalink
Merge branch '2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Nov 23, 2012
2 parents 19f2fdc + 40c83db commit d1bcc4e
Show file tree
Hide file tree
Showing 47 changed files with 216 additions and 122 deletions.
4 changes: 2 additions & 2 deletions book/controller.rst
Expand Up @@ -11,7 +11,7 @@ a serialized JSON array, an image, a redirect, a 404 error or anything else
you can dream up. The controller contains whatever arbitrary logic *your
application* needs to render the content of a page.

To see how simple this is, let's look at a Symfony2 controller in action.
See how simple this is by looking at a Symfony2 controller in action.
The following controller would render a page that simply prints ``Hello world!``::

use Symfony\Component\HttpFoundation\Response;
Expand Down Expand Up @@ -115,7 +115,7 @@ a controller object. Controllers are also called *actions*.
will house several controllers/actions (e.g. ``updateAction``, ``deleteAction``,
etc).

This controller is pretty straightforward, but let's walk through it:
This controller is pretty straightforward:

* *line 4*: Symfony2 takes advantage of PHP 5.3 namespace functionality to
namespace the entire controller class. The ``use`` keyword imports the
Expand Down
6 changes: 3 additions & 3 deletions book/doctrine.rst
Expand Up @@ -4,7 +4,7 @@
Databases and Doctrine
======================

Let's face it, one of the most common and challenging tasks for any application
One of the most common and challenging tasks for any application
involves persisting and reading information to and from a database. Fortunately,
Symfony comes integrated with `Doctrine`_, a library whose sole goal is to
give you powerful tools to make this easy. In this chapter, you'll learn the
Expand Down Expand Up @@ -420,7 +420,7 @@ of the bundle:
If you're following along with this example, you'll need to create a
route that points to this action to see it work.

Let's walk through this example:
Take a look at the previous example in more detail:

* **lines 9-12** In this section, you instantiate and work with the ``$product``
object like any other, normal PHP object.
Expand Down Expand Up @@ -965,7 +965,7 @@ table, and ``product.category_id`` column, and new foreign key:
Saving Related Entities
~~~~~~~~~~~~~~~~~~~~~~~

Now, let's see the code in action. Imagine you're inside a controller::
Now you can see this new code in action! Imagine you're inside a controller::

// ...

Expand Down
8 changes: 4 additions & 4 deletions book/forms.rst
Expand Up @@ -573,7 +573,7 @@ the correct values of a number of field options.
* ``max_length``: If the field is some sort of text field, then the ``max_length``
option can be guessed from the validation constraints (if ``Length`` or
``Range`` is used) or from the Doctrine metadata (via the field's length).

.. note::

These field options are *only* guessed if you're using Symfony to guess
Expand Down Expand Up @@ -625,7 +625,7 @@ of code. Of course, you'll usually need much more flexibility when rendering:
<input type="submit" />
</form>

Let's take a look at each part:
Take a look at each part:

* ``form_enctype(form)`` - If at least one field is a file upload field, this
renders the obligatory ``enctype="multipart/form-data"``;
Expand Down Expand Up @@ -1096,7 +1096,7 @@ In PHP, each form "fragment" is rendered via an individual template file.
To customize any part of how a form renders, you just need to override the
existing template by creating a new one.

To understand how this works, let's customize the ``form_row`` fragment and
To understand how this works, customize the ``form_row`` fragment and
add a class attribute to the ``div`` element that surrounds each row. To
do this, create a new template file that will store the new markup:

Expand Down Expand Up @@ -1340,7 +1340,7 @@ to define form output.
ever be needed in a single template.

.. caution::

This ``{% form_theme form _self %}`` functionality will *only* work
if your template extends another. If your template does not, you
must point ``form_theme`` to a separate template.
Expand Down
4 changes: 2 additions & 2 deletions book/from_flat_php_to_symfony2.rst
Expand Up @@ -426,7 +426,7 @@ an autoloader that Symfony provides. An autoloader is a tool that makes it
possible to start using PHP classes without explicitly including the file
containing the class.

First, `download symfony`_ and place it into a ``vendor/symfony/symfony/`` directory.
First, `download Symfony`_ and place it into a ``vendor/symfony/symfony/`` directory.
Next, create an ``app/bootstrap.php`` file. Use it to ``require`` the two
files in the application and to configure the autoloader:

Expand Down Expand Up @@ -740,7 +740,7 @@ Learn more from the Cookbook
* :doc:`/cookbook/controller/service`

.. _`Doctrine`: http://www.doctrine-project.org
.. _`download symfony`: http://symfony.com/download
.. _`download Symfony`: http://symfony.com/download
.. _`Routing`: https://github.com/symfony/Routing
.. _`Templating`: https://github.com/symfony/Templating
.. _`KnpBundles.com`: http://knpbundles.com/
Expand Down
8 changes: 7 additions & 1 deletion book/installation.rst
Expand Up @@ -67,6 +67,12 @@ Distribution:
For an exact version, replace `dev-master` with the latest Symfony version
(e.g. 2.1.1). For details, see the `Symfony Installation Page`_

.. tip::

To download the vendor files faster and without unnecessary directories
(e.g. "Tests"), add the ``--prefer-dist`` option at the end of any Composer
command.

This command may take several minutes to run as Composer download the Standard
Distribution along with all of the vendor libraries that it needs. When it finishes,
you should have a directory that looks something like this:
Expand Down Expand Up @@ -279,7 +285,7 @@ development! Your distribution may contain some sample code - check the
to learn about what sample code was included with your distribution and how
you can remove it later.

If you're new to Symfony, join us in the ":doc:`page_creation`", where you'll
If you're new to Symfony, check out ":doc:`page_creation`", where you'll
learn how to create pages, change configuration, and do everything else you'll
need in your new application.

Expand Down
6 changes: 3 additions & 3 deletions book/service_container.rst
Expand Up @@ -79,7 +79,7 @@ you need it::
$mailer = new Mailer('sendmail');
$mailer->send('ryan@foobar.net', ...);

This is easy enough. The imaginary ``Mailer`` class allows us to configure
This is easy enough. The imaginary ``Mailer`` class allows you to configure
the method used to deliver the email messages (e.g. ``sendmail``, ``smtp``, etc).
But what if you wanted to use the mailer service somewhere else? You certainly
don't want to repeat the mailer configuration *every* time you need to use
Expand Down Expand Up @@ -312,7 +312,7 @@ Importing other Container Configuration Resources
.. tip::

In this section, service configuration files are referred to as *resources*.
This is to highlight that fact that, while most configuration resources
This is to highlight the fact that, while most configuration resources
will be files (e.g. YAML, XML, PHP), Symfony2 is so flexible that configuration
could be loaded from anywhere (e.g. a database or even via an external
web service).
Expand Down Expand Up @@ -576,7 +576,7 @@ This approach is fine, but what if you decide later that the ``NewsletterManager
class needs a second or third constructor argument? What if you decide to
refactor our code and rename the class? In both cases, you'd need to find every
place where the ``NewsletterManager`` is instantiated and modify it. Of course,
the service container gives us a much more appealing option:
the service container gives you a much more appealing option:

.. configuration-block::

Expand Down
10 changes: 6 additions & 4 deletions book/testing.rst
Expand Up @@ -236,17 +236,19 @@ document::
)

The ``server`` array is the raw values that you'd expect to normally
find in the PHP `$_SERVER`_ superglobal. For example, to set the `Content-Type`
and `Referer` HTTP headers, you'd pass the following::
find in the PHP `$_SERVER`_ superglobal. For example, to set the `Content-Type`,
`Referer` and `X-Requested-With' HTTP headers, you'd pass the following (mind
the `HTTP_` prefix for non standard headers)::

$client->request(
'GET',
'/demo/hello/Fabien',
array(),
array(),
array(
'CONTENT_TYPE' => 'application/json',
'HTTP_REFERER' => '/foo/bar',
'CONTENT_TYPE' => 'application/json',
'HTTP_REFERER' => '/foo/bar',
'HTTP_X-Requested-With' => 'XMLHttpRequest',
)
);

Expand Down
4 changes: 2 additions & 2 deletions book/translation.rst
Expand Up @@ -831,15 +831,15 @@ locale to use for translation::
'Symfony2 is great',
array(),
'messages',
'fr_FR',
'fr_FR'
);

$this->get('translator')->transChoice(
'{0} There are no apples|{1} There is one apple|]1,Inf[ There are %count% apples',
10,
array('%count%' => 10),
'messages',
'fr_FR',
'fr_FR'
);

Translating Database Content
Expand Down
2 changes: 1 addition & 1 deletion components/config/definition.rst
Expand Up @@ -440,7 +440,7 @@ By changing a string value into an associative array with ``name`` as the key::
->ifString()
->then(function($v) { return array('name'=> $v); })
->end()
->scalarValue('name')->isRequired()
->scalarNode('name')->isRequired()
// ...
->end()
;
Expand Down
14 changes: 13 additions & 1 deletion components/console/introduction.rst
Expand Up @@ -23,7 +23,7 @@ You can install the component in many different ways:
Creating a basic Command
------------------------

To make a console command to greet us from the command line, create ``GreetCommand.php``
To make a console command that greets you from the command line, create ``GreetCommand.php``
and add the following to it::

namespace Acme\DemoBundle\Command;
Expand Down Expand Up @@ -138,6 +138,18 @@ Available foreground and background colors are: ``black``, ``red``, ``green``,

And available options are: ``bold``, ``underscore``, ``blink``, ``reverse`` and ``conceal``.

You can also set these colors and options inside the tagname::

// green text
$output->writeln('<fg=green>foo</fg=green>');

// black text on a cyan background
$output->writeln('<fg=black;bg=cyan>foo</fg=black;bg=cyan>');

// bold text on a yellow background
$output->writeln('<bg=yellow;options=bold>foo</bg=yellow;options=bold>');


Using Command Arguments
-----------------------

Expand Down
2 changes: 1 addition & 1 deletion components/dependency_injection/advanced.rst
Expand Up @@ -121,5 +121,5 @@ the service itself gets loaded. To do so, you can use the ``file`` directive.
$definition->setFile('%kernel.root_dir%/src/path/to/file/foo.php');
$container->setDefinition('foo', $definition);
Notice that symfony will internally call the PHP function require_once
Notice that Symfony will internally call the PHP function require_once
which means that your file will be included only once per request.
2 changes: 1 addition & 1 deletion components/dependency_injection/definitions.rst
Expand Up @@ -91,7 +91,7 @@ You can add a new argument to the end of the arguments array using::

$definition->addArgument($argument);

The argument can be a string, an array, a service parameter by using ``%paramater_name%``
The argument can be a string, an array, a service parameter by using ``%parameter_name%``
or a service id by using ::

use Symfony\Component\DependencyInjection\Reference;
Expand Down
4 changes: 2 additions & 2 deletions components/dom_crawler.rst
Expand Up @@ -179,7 +179,7 @@ Links

To find a link by name (or a clickable image by its ``alt`` attribute), use
the ``selectLink`` method on an existing crawler. This returns a Crawler
instance with just the selected link(s). Calling ``link()`` gives us a special
instance with just the selected link(s). Calling ``link()`` gives you a special
:class:`Symfony\\Component\\DomCrawler\\Link` object::

$linksCrawler = $crawler->selectLink('Go elsewhere...');
Expand Down Expand Up @@ -319,4 +319,4 @@ directly::
$crawler = $client->submit($form);

.. _`Goutte`: https://github.com/fabpot/goutte
.. _Packagist: https://packagist.org/packages/symfony/dom-crawler
.. _Packagist: https://packagist.org/packages/symfony/dom-crawler
2 changes: 1 addition & 1 deletion components/filesystem.rst
Expand Up @@ -33,7 +33,7 @@ endpoint for filesystem operations::
try {
$fs->mkdir('/tmp/random/dir/' . mt_rand());
} catch (IOException $e) {
echo "An error occured while creating your directory";
echo "An error occurred while creating your directory";
}

.. note::
Expand Down
2 changes: 1 addition & 1 deletion components/http_foundation/introduction.rst
Expand Up @@ -227,7 +227,7 @@ by using the following methods:
returns the list of accepted languages ordered by descending quality;

* :method:`Symfony\\Component\\HttpFoundation\\Request::getCharsets`:
returns the list of accepted languages ordered by descending quality;
returns the list of accepted charsets ordered by descending quality;

.. versionadded:: 2.2
The :class:`Symfony\\Component\\HttpFoundation\\AcceptHeader` class is new in Symfony 2.2.
Expand Down
2 changes: 1 addition & 1 deletion components/http_foundation/session_configuration.rst
Expand Up @@ -204,7 +204,7 @@ Both methods return a Unix timestamp (relative to the server).
This meta-data can be used to explicitly expire a session on access, e.g.::

$session->start();
if (time() - $session->getMetadataBag()->getLastUpdate() > $maxIdleTime) {
if (time() - $session->getMetadataBag()->getLastUsed() > $maxIdleTime) {
$session->invalidate();
throw new SessionExpired(); // redirect to expired session page
}
Expand Down
6 changes: 3 additions & 3 deletions components/http_foundation/sessions.rst
Expand Up @@ -37,7 +37,7 @@ Quick example::

.. note::

Symfony sessions are designed to replace several native PHP funtions.
Symfony sessions are designed to replace several native PHP functions.
Applications should avoid using ``session_start()``, ``session_regenerate_id()``,
``session_id()``, ``session_name()``, and ``session_destroy()`` and instead
use the APIs in the following section.
Expand Down Expand Up @@ -131,7 +131,7 @@ an array. A few methods exist for "Bag" management:
Session meta-data

* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getMetadataBag`:
Gets the :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\MetadataBag`
Gets the :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\MetadataBag`
which contains information about the session.


Expand Down Expand Up @@ -239,7 +239,7 @@ Flash messages
~~~~~~~~~~~~~~

The purpose of the :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface`
is to provide a way of settings and retrieving messages on a per session basis.
is to provide a way of setting and retrieving messages on a per session basis.
The usual workflow for flash messages would be set in an request, and displayed
after a page redirect. For example, a user submits a form which hits an update
controller, and after processing the controller redirects the page to either the
Expand Down
2 changes: 1 addition & 1 deletion components/yaml.rst
Expand Up @@ -122,7 +122,7 @@ When loading a YAML file, it is sometimes better to use the
use Symfony\Component\Yaml\Yaml;
$loader = Yaml::parse('/path/to/file.yml');
$yaml = Yaml::parse('/path/to/file.yml');
The :method:`Symfony\\Component\\Yaml\\Yaml::parse` static method takes a YAML
string or a file containing YAML. Internally, it calls the
Expand Down
6 changes: 3 additions & 3 deletions contributing/code/conventions.rst
Expand Up @@ -32,7 +32,7 @@ is a main relation:
* a ``CookieJar`` has many ``Cookie`` objects;

* a Service ``Container`` has many services and many parameters (as services
is the main relation, we use the naming convention for this relation);
is the main relation, the naming convention is used for this relation);

* a Console ``Input`` has many arguments and many options. There is no "main"
relation, and so the naming convention does not apply.
Expand Down Expand Up @@ -72,7 +72,7 @@ must be used instead (where ``XXX`` is the name of the related thing):

.. note::

While "setXXX" and "replaceXXX" are very similar, there is one notable
difference: "setXXX" may replace, or add new elements to the relation.
While "setXXX" and "replaceXXX" are very similar, there is one notable
difference: "setXXX" may replace, or add new elements to the relation.
"replaceXXX", on the other hand, cannot add new elements. If an unrecognized
key as passed to "replaceXXX" it must throw an exception.
2 changes: 1 addition & 1 deletion contributing/code/patches.rst
Expand Up @@ -29,7 +29,7 @@ Set up your user information with your real name and a working email address:
.. tip::

If you are new to Git, we highly recommend you to read the excellent and
If you are new to Git, you are highly recommended to read the excellent and
free `ProGit`_ book.

.. tip::
Expand Down

0 comments on commit d1bcc4e

Please sign in to comment.