Skip to content

Changed uses of we in several cookbooks #1909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cookbook/assetic/asset_management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ and deployment processes.

To use a filter, you first need to specify it in the Assetic configuration.
Adding a filter here doesn't mean it's being used - it just means that it's
available to use (we'll use the filter below).
available to use (you'll use the filter below).

For example to use the JavaScript YUI Compressor the following config should
be added:
Expand Down
4 changes: 2 additions & 2 deletions cookbook/bundles/override.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ something beyond just the class name, you should use a compiler pass::
}
}

In this example we fetch the service definition of the original service, and set
its class name to our own class.
In this example you fetch the service definition of the original service, and set
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 -
Expand Down
28 changes: 14 additions & 14 deletions cookbook/configuration/apache_router.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ One of these ways is by letting apache handle routes directly, rather than using
Change Router Configuration Parameters
--------------------------------------

To dump Apache routes we must first tweak some configuration parameters to tell
To dump Apache routes you must first tweak some configuration parameters to tell
Symfony2 to use the ``ApacheUrlMatcher`` instead of the default one:

.. code-block:: yaml

# app/config/config_prod.yml
parameters:
router.options.matcher.cache_class: ~ # disable router cache
Expand All @@ -26,27 +26,27 @@ Symfony2 to use the ``ApacheUrlMatcher`` instead of the default one:
extends :class:`Symfony\\Component\\Routing\\Matcher\\UrlMatcher` so even
if you don't regenerate the url_rewrite rules, everything will work (because
at the end of ``ApacheUrlMatcher::match()`` a call to ``parent::match()``
is done).
is done).

Generating mod_rewrite rules
----------------------------

To test that it's working, let's create a very basic route for demo bundle:

.. code-block:: yaml

# app/config/routing.yml
hello:
pattern: /hello/{name}
defaults: { _controller: AcmeDemoBundle:Demo:hello }
Now we generate **url_rewrite** rules:


Now generate **url_rewrite** rules:

.. code-block:: bash

$ php app/console router:dump-apache -e=prod --no-debug

Which should roughly output the following:

.. code-block:: apache
Expand All @@ -59,7 +59,7 @@ Which should roughly output the following:
RewriteCond %{REQUEST_URI} ^/hello/([^/]+?)$
RewriteRule .* app.php [QSA,L,E=_ROUTING__route:hello,E=_ROUTING_name:%1,E=_ROUTING__controller:AcmeDemoBundle\:Demo\:hello]

You can now rewrite `web/.htaccess` to use the new rules, so with our example
You can now rewrite `web/.htaccess` to use the new rules, so with this example
it should look like this:

.. code-block:: apache
Expand All @@ -82,15 +82,15 @@ it should look like this:

That's it!
You're now all set to use Apache Route rules.

Additional tweaks
-----------------

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

// web/app.php

require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/AppKernel.php';
//require_once __DIR__.'/../app/AppCache.php';
Expand Down
18 changes: 9 additions & 9 deletions cookbook/configuration/override_dir_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
How to override Symfony's Default Directory Structure
=====================================================

Symfony automatically ships with a default directory structure. You can
easily override this directory structure to create your own. The default
Symfony automatically ships with a default directory structure. You can
easily override this directory structure to create your own. The default
directory structure is:

.. code-block:: text
Expand All @@ -26,7 +26,7 @@ directory structure is:
Override the ``cache`` directory
--------------------------------

You can override the cache directory by overriding the ``getCacheDir`` method
You can override the cache directory by overriding the ``getCacheDir`` method
in the ``AppKernel`` class of you application::

// app/AppKernel.php
Expand All @@ -43,7 +43,7 @@ in the ``AppKernel`` class of you application::
}

``$this->rootDir`` is the absolute path to the ``app`` directory and ``$this->environment``
is the current environment (i.e. ``dev``). In this case we have changed
is the current environment (i.e. ``dev``). In this case you have changed
the location of the cache directory to ``app/{environment}/cache``.

.. caution::
Expand All @@ -56,8 +56,8 @@ the location of the cache directory to ``app/{environment}/cache``.
Override the ``logs`` directory
-------------------------------

Overriding the ``logs`` directory is the same as overriding the ``cache``
directory, the only difference is that you need to override the ``getLogDir``
Overriding the ``logs`` directory is the same as overriding the ``cache``
directory, the only difference is that you need to override the ``getLogDir``
method::

// app/AppKernel.php
Expand All @@ -73,7 +73,7 @@ method::
}
}

Here we have changed the location of the directory to ``app/{environment}/logs``.
Here you have changed the location of the directory to ``app/{environment}/logs``.

Override the ``web`` directory
------------------------------
Expand All @@ -98,7 +98,7 @@ may need to modify the paths inside these files::

.. note::

If you use the AsseticBundle you need to configure this, so it can use
If you use the AsseticBundle you need to configure this, so it can use
the correct ``web`` directory:

.. code-block:: yaml
Expand All @@ -110,7 +110,7 @@ may need to modify the paths inside these files::
# ...
read_from: "%kernel.root_dir%/../../public_html"

Now you just need to dump the assets again and your application should
Now you just need to dump the assets again and your application should
work:

.. code-block:: bash
Expand Down
2 changes: 1 addition & 1 deletion cookbook/controller/error_pages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ control you need:
information, see :ref:`kernel-kernel.exception`.

All of the error templates live inside ``TwigBundle``. To override the
templates, we simply rely on the standard method for overriding templates that
templates, simply rely on the standard method for overriding templates that
live inside a bundle. For more information, see
:ref:`overriding-bundle-templates`.

Expand Down
6 changes: 3 additions & 3 deletions cookbook/controller/service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ extends the base
this works fine, controllers can also be specified as services.

To refer to a controller that's defined as a service, use the single colon (:)
notation. For example, suppose we've defined a service called
``my_controller`` and we want to forward to a method called ``indexAction()``
notation. For example, suppose you've defined a service called
``my_controller`` and you want to forward to a method called ``indexAction()``
inside the service::

$this->forward('my_controller:indexAction', array('foo' => $bar));
Expand Down Expand Up @@ -62,4 +62,4 @@ service, you need to specify your service as follows::
In this example, ``my_bundle.annot_controller`` should be the id of the
``AnnotController`` instance defined in the service container. This is
documented in the :doc:`/bundles/SensioFrameworkExtraBundle/annotations/routing`
chapter.
chapter.
4 changes: 2 additions & 2 deletions cookbook/doctrine/file_uploads.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ object, which is what's returned after a ``file`` field is submitted::
return;
}

// we use the original file name here but you should
// use the original file name here but you should
// sanitize it at least to avoid any security issues

// move takes the target directory and then the target filename to move to
$this->file->move($this->getUploadRootDir(), $this->file->getClientOriginalName());

Expand Down
2 changes: 1 addition & 1 deletion cookbook/doctrine/reverse_engineering.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ to a post record thanks to a foreign key constraint.
Before diving into the recipe, be sure your database connection parameters are
correctly setup in the ``app/config/parameters.ini`` file (or wherever your
database configuration is kept) and that you have initialized a bundle that
will host your future entity class. In this tutorial, we will assume that
will host your future entity class. In this tutorial it's assumed that
an ``AcmeBlogBundle`` exists and is located under the ``src/Acme/BlogBundle``
folder.

Expand Down
2 changes: 1 addition & 1 deletion cookbook/event_dispatcher/before_after_filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,6 @@ event:
That's it! The ``TokenListener`` is now notified before every controller is
executed (``onKernelController``) and after every controller returns a response
(``onKernelResponse``). By making specific controllers implement the ``TokenAuthenticatedController``
interface, our listener knows which controllers it should take action on.
interface, your listener knows which controllers it should take action on.
And by storing a value in the request's "attributes" bag, the ``onKernelResponse``
method knows to add the extra header. Have fun!
2 changes: 1 addition & 1 deletion cookbook/event_dispatcher/class_extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ and *add* the method ``bar()``:
{
public function onFooMethodIsNotFound(HandleUndefinedMethodEvent $event)
{
// we only want to respond to the calls to the 'bar' method
// only respond to the calls to the 'bar' method
if ('bar' != $event->getMethod()) {
// allow another listener to take care of this unknown method
return;
Expand Down
2 changes: 1 addition & 1 deletion cookbook/logging/monolog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ To log a message simply get the logger service from the container in
your controller::

$logger = $this->get('logger');
$logger->info('We just got the logger');
$logger->info('I just got the logger');
$logger->err('An error occurred');

.. tip::
Expand Down
2 changes: 1 addition & 1 deletion cookbook/routing/redirect_in_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Your configuration will look like this:

Your ``AppBundle`` is registered to handle all requests under ``/app``.

We configure a route for the ``/`` path and let :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController`
You configure a route for the ``/`` path and let :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\RedirectController`
handle it. This controller is built-in and offers two methods for redirecting request:

* ``redirect`` redirects to another *route*. You must provide the ``route``
Expand Down
10 changes: 5 additions & 5 deletions cookbook/service_container/event_listener.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ component and can be viewed in the :class:`Symfony\\Component\\HttpKernel\\Kerne

To hook into an event and add your own custom logic, you have to create
a service that will act as an event listener on that event. In this entry,
we will create a service that will act as an Exception Listener, allowing
you will create a service that will act as an Exception Listener, allowing
us to modify how exceptions are shown by our application. The ``KernelEvents::EXCEPTION``
event is just one of the core kernel events::

Expand All @@ -25,11 +25,11 @@ event is just one of the core kernel events::
{
public function onKernelException(GetResponseForExceptionEvent $event)
{
// We get the exception object from the received event
// You get the exception object from the received event
$exception = $event->getException();
$message = 'My Error says: ' . $exception->getMessage() . ' with code: ' . $exception->getCode();

// Customize our response object to display our exception details
// Customize your response object to display the exception details
$response = new Response();
$response->setContent($message);

Expand All @@ -42,7 +42,7 @@ event is just one of the core kernel events::
$response->setStatusCode(500);
}

// Send our modified response object to the event
// Send the modified response object to the event
$event->setResponse($response);
}
}
Expand All @@ -53,7 +53,7 @@ event is just one of the core kernel events::
the ``kernel.exception`` event, it is :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseForExceptionEvent`.
To see what type of object each event listener receives, see :class:`Symfony\\Component\\HttpKernel\\KernelEvents`.

Now that the class is created, we just need to register it as a service and
Now that the class is created, you just need to register it as a service and
notify Symfony that it is a "listener" on the ``kernel.exception`` event by
using a special "tag":

Expand Down
6 changes: 3 additions & 3 deletions cookbook/service_container/scopes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ when compiling the container. Read the sidebar below for more details.
the scope of the service, so it defaults to `container`. In other words,
everytime you ask the container for the `my_mailer` service, you get
the same object back. This is usually how you want your services to work.

Imagine, however, that you need the `request` service in your `my_mailer`
service, maybe because you're reading the URL of the current request.
So, you add it as a constructor argument. Let's look at why this presents
Expand Down Expand Up @@ -67,7 +67,7 @@ when compiling the container. Read the sidebar below for more details.
.. note::

A service can of course depend on a service from a wider scope without
any issue.
any issue.

Setting the Scope in the Definition
-----------------------------------
Expand Down Expand Up @@ -116,7 +116,7 @@ new service in the `request` scope.
But this is not always possible (for instance, a twig extension must be in
the `container` scope as the Twig environment needs it as a dependency).
In these cases, you should pass the entire container into your service and
retrieve your dependency from the container each time we need it to be sure
retrieve your dependency from the container each time you need it to be sure
you have the right instance::

// src/Acme/HelloBundle/Mail/Mailer.php
Expand Down
10 changes: 5 additions & 5 deletions cookbook/symfony1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ at its core, the skills used to master a symfony1 project continue to be
very relevant when developing in Symfony2. Sure, ``app.yml`` is gone, but
routing, controllers and templates all remain.

In this chapter, we'll walk through the differences between symfony1 and Symfony2.
This chapter walks through the differences between symfony1 and Symfony2.
As you'll see, many tasks are tackled in a slightly different way. You'll
come to appreciate these minor differences as they promote stable, predictable,
testable and decoupled code in your Symfony2 applications.

So, sit back and relax as we take you from "then" to "now".
So, sit back and relax as your taken from "then" to "now".

Directory Structure
-------------------
Expand Down Expand Up @@ -61,7 +61,7 @@ In other words, the code that drives your application lives in many different
places.

In Symfony2, life is much simpler because *all* Symfony2 code must live in
a bundle. In our pretend symfony1 project, all the code *could* be moved
a bundle. In the pretend symfony1 project, all the code *could* be moved
into one or more plugins (which is a very good practice, in fact). Assuming
that all modules, PHP classes, schema, routing configuration, etc were moved
into a plugin, the symfony1 ``plugins/`` directory would be very similar
Expand Down Expand Up @@ -134,7 +134,7 @@ The file itself lives at
``vendor/bundle/Sensio/Bundle/FrameworkExtraBundle/SensioFrameworkExtraBundle.php``.
As you can see, the location of the file follows the namespace of the class.
Specifically, the namespace, ``Sensio\Bundle\FrameworkExtraBundle``, spells out
the directory that the file should live in
the directory that the file should live in
(``vendor/bundle/Sensio/Bundle/FrameworkExtraBundle``). This is because, in the
``app/autoload.php`` file, you'll configure Symfony to look for the ``Sensio``
namespace in the ``vendor/bundle`` directory:
Expand Down Expand Up @@ -251,7 +251,7 @@ In Symfony2, the bundles are activated inside the application kernel::
...,
new Acme\DemoBundle\AcmeDemoBundle(),
);

return $bundles;
}

Expand Down
6 changes: 3 additions & 3 deletions cookbook/templating/PHP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ your application configuration file:
.. configuration-block::

.. code-block:: yaml

# app/config/config.yml
framework:
# ...
Expand All @@ -42,7 +42,7 @@ your application configuration file:
'templating' => array(
'engines' => array('twig', 'php'),
),
));
));

You can now render a PHP template instead of a Twig one simply by using the
``.php`` extension in the template name instead of ``.twig``. The controller
Expand Down Expand Up @@ -82,7 +82,7 @@ Decorating Templates
--------------------

More often than not, templates in a project share common elements, like the
well-known header and footer. In Symfony2, we like to think about this problem
well-known header and footer. In Symfony2, this problem is thought about
differently: a template can be decorated by another one.

The ``index.html.php`` template is decorated by ``layout.html.php``, thanks to
Expand Down
2 changes: 1 addition & 1 deletion cookbook/templating/global_variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Now, the variable ``ga_tracking`` is available in all Twig templates:

.. code-block:: html+jinja

<p>Our google tracking code is: {{ ga_tracking }} </p>
<p>The google tracking code is: {{ ga_tracking }} </p>

It's that easy! You can also take advantage of the built-in :ref:`book-service-container-parameters`
system, which lets you isolate or reuse the value:
Expand Down
Loading