From 3fce92250b459b14d3e5d5879d626e91f2de3cd7 Mon Sep 17 00:00:00 2001 From: John Kary Date: Sat, 10 Nov 2012 01:16:33 -0600 Subject: [PATCH 01/34] Fix typo --- cookbook/form/dynamic_form_generation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/form/dynamic_form_generation.rst b/cookbook/form/dynamic_form_generation.rst index 904ad85f5e8..feb8a816d4b 100644 --- a/cookbook/form/dynamic_form_generation.rst +++ b/cookbook/form/dynamic_form_generation.rst @@ -35,7 +35,7 @@ of what a bare form class looks like:: Let's assume for a moment that this form utilizes an imaginary "Product" class that has only two relevant properties ("name" and "price"). The form generated -from this class will look the exact same regardless of a new Product is being created +from this class will look the exact same regardless if a new Product is being created or if an existing product is being edited (e.g. a product fetched from the database). Suppose now, that you don't want the user to be able to change the ``name`` value From 0862175e1d763488d18d4327cebf486b8a830ca5 Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Sun, 11 Nov 2012 19:30:39 +0100 Subject: [PATCH 02/34] Update components/http_foundation/sessions.rst added missing backslash --- components/http_foundation/sessions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/http_foundation/sessions.rst b/components/http_foundation/sessions.rst index 4d7ded9bbbb..f5347f3c2f0 100644 --- a/components/http_foundation/sessions.rst +++ b/components/http_foundation/sessions.rst @@ -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. From 7c1685ca8da597e67b3b190241f433a0cd7f379f Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Sun, 11 Nov 2012 19:47:19 +0100 Subject: [PATCH 03/34] Update components/http_foundation/sessions.rst fixed typo --- components/http_foundation/sessions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/http_foundation/sessions.rst b/components/http_foundation/sessions.rst index 4d7ded9bbbb..2772ae982ae 100644 --- a/components/http_foundation/sessions.rst +++ b/components/http_foundation/sessions.rst @@ -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 From ce350250f42242680a796fb0322a7acd36f08e42 Mon Sep 17 00:00:00 2001 From: Jacob Dreesen Date: Mon, 12 Nov 2012 15:32:14 +0100 Subject: [PATCH 04/34] Fixed function name Function name is not MetadataBag::getLastUpdate() but getLastUsed() --- components/http_foundation/session_configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/http_foundation/session_configuration.rst b/components/http_foundation/session_configuration.rst index 558f7f57d48..f445f740b76 100644 --- a/components/http_foundation/session_configuration.rst +++ b/components/http_foundation/session_configuration.rst @@ -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 } From 814f57455630f8c172243387f8f4318e12d9e0c1 Mon Sep 17 00:00:00 2001 From: Cory Becker Date: Mon, 12 Nov 2012 14:54:05 -0600 Subject: [PATCH 05/34] Minor grammar tweak in service container documentation --- book/service_container.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/service_container.rst b/book/service_container.rst index 19bd75973b6..f810aecf4da 100644 --- a/book/service_container.rst +++ b/book/service_container.rst @@ -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). From c318400ec78401881ef90516b8b6456a310f3973 Mon Sep 17 00:00:00 2001 From: Thomas Tourlourat Date: Thu, 15 Nov 2012 11:21:29 +0100 Subject: [PATCH 06/34] Allow & Force the 'em' option. Fix to work with Sf2.1 OptionsResolver --- cookbook/form/data_transformers.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cookbook/form/data_transformers.rst b/cookbook/form/data_transformers.rst index 820e096c19a..3fdcad34101 100644 --- a/cookbook/form/data_transformers.rst +++ b/cookbook/form/data_transformers.rst @@ -125,6 +125,23 @@ issue field in some form. ); } + public function setDefaultOptions(OptionsResolverInterface $resolver) + { + $resolver->setDefaults(array( + 'data_class' => 'Acme\TaskBundle\Entity\Task' + )); + + $resolver->setRequired(array( + 'em' + )); + + $resolver->setAllowedTypes(array( + 'em' => 'Doctrine\Common\Persistence\ObjectManager' + )); + + // ... + } + // ... } From 9fb6dd7cbcd87b90839566b908d5d631ed2f6828 Mon Sep 17 00:00:00 2001 From: Richard Miller Date: Thu, 15 Nov 2012 19:13:58 +0000 Subject: [PATCH 07/34] Correcting method names in config component example --- components/config/definition.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/config/definition.rst b/components/config/definition.rst index dd867c82a55..493384e81bf 100644 --- a/components/config/definition.rst +++ b/components/config/definition.rst @@ -383,7 +383,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() ; From 7b9733acad0efb81704eb4a6fe8ccf07fd6c0f4d Mon Sep 17 00:00:00 2001 From: Markus Weiland Date: Thu, 15 Nov 2012 17:59:38 -0500 Subject: [PATCH 08/34] Changed function definition to match AbstractTypeExtension interface. --- cookbook/form/create_form_type_extension.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cookbook/form/create_form_type_extension.rst b/cookbook/form/create_form_type_extension.rst index 116992d1280..5c7e974c24c 100644 --- a/cookbook/form/create_form_type_extension.rst +++ b/cookbook/form/create_form_type_extension.rst @@ -219,8 +219,9 @@ it in the view:: * * @param \Symfony\Component\Form\FormView $view * @param \Symfony\Component\Form\FormInterface $form + * @param array $options */ - public function buildView(FormView $view, FormInterface $form) + public function buildView(FormView $view, FormInterface $form, array $options) { if (array_key_exists('image_path', $options)) { $parentData = $form->getParent()->getData(); From 8b05034e223c8a9877da86668e5cdd7df9a6cfef Mon Sep 17 00:00:00 2001 From: Thomas Tourlourat Date: Fri, 16 Nov 2012 10:26:37 +0100 Subject: [PATCH 09/34] Add comma --- cookbook/form/data_transformers.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cookbook/form/data_transformers.rst b/cookbook/form/data_transformers.rst index 3fdcad34101..2b68992ea72 100644 --- a/cookbook/form/data_transformers.rst +++ b/cookbook/form/data_transformers.rst @@ -128,15 +128,15 @@ issue field in some form. public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( - 'data_class' => 'Acme\TaskBundle\Entity\Task' + 'data_class' => 'Acme\TaskBundle\Entity\Task', )); $resolver->setRequired(array( - 'em' + 'em', )); $resolver->setAllowedTypes(array( - 'em' => 'Doctrine\Common\Persistence\ObjectManager' + 'em' => 'Doctrine\Common\Persistence\ObjectManager', )); // ... From 3615325e4526f06750114b29efc2a89fe56a6ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C5=82odzimierz=20Gajda?= Date: Fri, 16 Nov 2012 18:30:04 +0100 Subject: [PATCH 10/34] [YAML] minor fix (loader => yml) --- components/yaml.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/yaml.rst b/components/yaml.rst index 365740729f2..33ea78568a2 100644 --- a/components/yaml.rst +++ b/components/yaml.rst @@ -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 From 61b2b1aa77c9acbdda79cee4bb4311a1a7f8f370 Mon Sep 17 00:00:00 2001 From: Lee Conlin Date: Sat, 17 Nov 2012 21:35:49 +0000 Subject: [PATCH 11/34] Made all namespaces Acme\UserBundle to be consistent throughout document instead of some having Acme\UserBundle and some Acme\Bundle\UserBundle --- cookbook/security/entity_provider.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cookbook/security/entity_provider.rst b/cookbook/security/entity_provider.rst index b1f75d26104..b8e1d9569d2 100644 --- a/cookbook/security/entity_provider.rst +++ b/cookbook/security/entity_provider.rst @@ -265,7 +265,7 @@ For this example, the first three methods will return ``true`` whereas the .. code-block:: php // src/Acme/UserBundle/Entity/User.php - namespace Acme\Bundle\UserBundle\Entity; + namespace Acme\UserBundle\Entity; // ... use Symfony\Component\Security\Core\User\AdvancedUserInterface; @@ -417,7 +417,7 @@ more users. As a group is also a role, the previous ``getRoles()`` method now returns the list of related groups:: // src/Acme/UserBundle/Entity/User.php - namespace Acme\Bundle\UserBundle\Entity; + namespace Acme\UserBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; // ... @@ -451,7 +451,7 @@ implements the :class:`Symfony\\Component\\Security\\Core\\Role\\RoleInterface` that forces it to have a ``getRole()`` method:: // src/Acme/Bundle/UserBundle/Entity/Group.php - namespace Acme\Bundle\UserBundle\Entity; + namespace Acme\UserBundle\Entity; use Symfony\Component\Security\Core\Role\RoleInterface; use Doctrine\Common\Collections\ArrayCollection; @@ -507,7 +507,7 @@ relationship in the ``UserRepository::loadUserByUsername()`` method. This will fetch the user and his associated roles / groups with a single query:: // src/Acme/UserBundle/Entity/UserRepository.php - namespace Acme\Bundle\UserBundle\Entity; + namespace Acme\UserBundle\Entity; // ... From fff4fdb05d202a42e61ae2731757bd4f8c81e9a5 Mon Sep 17 00:00:00 2001 From: Florin Patan Date: Sun, 18 Nov 2012 16:55:10 +0200 Subject: [PATCH 12/34] Added more info about no install artifacts --- book/installation.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/book/installation.rst b/book/installation.rst index aab96d7f1c5..d03ce638553 100644 --- a/book/installation.rst +++ b/book/installation.rst @@ -62,6 +62,12 @@ Distribution: php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/Symfony +.. tip:: + If you don't want to have the "Tests" directories in your sources when using + Composer, you'll need to add the "--prefer-dist" option at the end of any + command and it will skip those directories from the listing. Here you can view + more information about `light-weight distribution packages` and Composer. + 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: @@ -313,3 +319,4 @@ install all the necessary project dependencies. .. _`downloading Composer`: http://getcomposer.org/download/ .. _`Apache`: http://httpd.apache.org/docs/current/mod/core.html#documentroot .. _`Nginx`: http://wiki.nginx.org/Symfony +.. _`light-weight distribution packages`: http://getcomposer.org/doc/02-libraries.md#light-weight-distribution-packages From 868b73a194b22cbb082d797d5b981b67b0059fd4 Mon Sep 17 00:00:00 2001 From: Richard Miller Date: Sun, 18 Nov 2012 19:26:19 +0000 Subject: [PATCH 13/34] Changing some uses of we/let's/our --- book/controller.rst | 4 +-- book/doctrine.rst | 12 ++++----- book/forms.rst | 8 +++--- book/installation.rst | 10 +++---- book/service_container.rst | 4 +-- components/console/introduction.rst | 4 +-- components/dom_crawler.rst | 4 +-- contributing/code/conventions.rst | 6 ++--- contributing/code/patches.rst | 2 +- contributing/documentation/overview.rst | 26 +++++++++---------- cookbook/console/console_command.rst | 8 +++--- .../event_dispatcher/before_after_filters.rst | 2 +- cookbook/form/dynamic_form_generation.rst | 2 +- cookbook/service_container/event_listener.rst | 2 +- quick_tour/the_architecture.rst | 6 ++--- quick_tour/the_big_picture.rst | 10 +++---- quick_tour/the_controller.rst | 16 ++++++------ quick_tour/the_view.rst | 4 +-- reference/configuration/framework.rst | 4 +-- reference/constraints/Valid.rst | 20 +++++++------- reference/forms/types/collection.rst | 22 ++++++++-------- .../forms/types/options/by_reference.rst.inc | 6 ++--- 22 files changed, 91 insertions(+), 91 deletions(-) diff --git a/book/controller.rst b/book/controller.rst index a94cd1a9194..2d3f2ec6561 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -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; @@ -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 diff --git a/book/doctrine.rst b/book/doctrine.rst index 0312d8f313f..b9dc2b69c9a 100644 --- a/book/doctrine.rst +++ b/book/doctrine.rst @@ -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 @@ -15,8 +15,8 @@ be. Doctrine is totally decoupled from Symfony and using it is optional. This chapter is all about the Doctrine ORM, which aims to let you map - objects to a relational database (such as *MySQL*, *PostgreSQL* or - *Microsoft SQL*). If you prefer to use raw database queries, this is + objects to a relational database (such as *MySQL*, *PostgreSQL* or + *Microsoft SQL*). If you prefer to use raw database queries, this is easy, and explained in the ":doc:`/cookbook/doctrine/dbal`" cookbook entry. You can also persist data to `MongoDB`_ using Doctrine ODM library. For @@ -418,7 +418,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: +Walking through this example: * **lines 9-12** In this section, you instantiate and work with the ``$product`` object like any other, normal PHP object. @@ -956,7 +956,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, to see the code in action. Imagine you're inside a controller:: // ... @@ -1371,7 +1371,7 @@ Some notable or interesting tasks include: .. caution:: - Don't forget to add the ``--no-debug`` switch, because the debug flag is + Don't forget to add the ``--no-debug`` switch, because the debug flag is always set to true, even if the environment is set to ``prod``. * ``doctrine:mapping:import`` - allows Doctrine to introspect an existing diff --git a/book/forms.rst b/book/forms.rst index 51bc5bcb7b1..c2214b52293 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -524,7 +524,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 ``MaxLength`` or ``Max`` 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 @@ -576,7 +576,7 @@ of code. Of course, you'll usually need much more flexibility when rendering: -Let's take a look at each part: +Taking 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"``; @@ -1029,7 +1029,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: @@ -1259,7 +1259,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. diff --git a/book/installation.rst b/book/installation.rst index 7449433fef6..417baf1b6d2 100644 --- a/book/installation.rst +++ b/book/installation.rst @@ -75,8 +75,8 @@ something like this: .. note:: - You can easily override the default directory structure. See - :doc:`/cookbook/configuration/override_dir_structure` for more + You can easily override the default directory structure. See + :doc:`/cookbook/configuration/override_dir_structure` for more information. Updating Vendors @@ -135,9 +135,9 @@ If there are any issues, correct them now before moving on. **2. Using Acl on a system that does not support chmod +a** - Some systems don't support ``chmod +a``, but do support another utility + Some systems don't support ``chmod +a``, but do support another utility called ``setfacl``. You may need to `enable ACL support`_ on your partition - and install setfacl before using it (as is the case with Ubuntu), like + and install setfacl before using it (as is the case with Ubuntu), like so: .. code-block:: bash @@ -188,7 +188,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, look at ":doc:`page_creation`", where you'll learn how to create pages, change configuration, and do everything else you'll need in your new application. diff --git a/book/service_container.rst b/book/service_container.rst index 19bd75973b6..afbbdb1b362 100644 --- a/book/service_container.rst +++ b/book/service_container.rst @@ -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 @@ -578,7 +578,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:: diff --git a/components/console/introduction.rst b/components/console/introduction.rst index 73e82cf118e..475a39fab5e 100755 --- a/components/console/introduction.rst +++ b/components/console/introduction.rst @@ -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 to greet you from the command line, create ``GreetCommand.php`` and add the following to it:: namespace Acme\DemoBundle\Command; @@ -439,4 +439,4 @@ Learn More! * :doc:`/components/console/usage` * :doc:`/components/console/single_command_tool` -.. _Packagist: https://packagist.org/packages/symfony/console \ No newline at end of file +.. _Packagist: https://packagist.org/packages/symfony/console diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index fac665deacd..2daf75dfe33 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -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...'); @@ -319,4 +319,4 @@ directly:: $crawler = $client->submit($form); .. _`Goutte`: https://github.com/fabpot/goutte -.. _Packagist: https://packagist.org/packages/symfony/dom-crawler \ No newline at end of file +.. _Packagist: https://packagist.org/packages/symfony/dom-crawler diff --git a/contributing/code/conventions.rst b/contributing/code/conventions.rst index 3e8fa8db0e5..1572e68cf34 100644 --- a/contributing/code/conventions.rst +++ b/contributing/code/conventions.rst @@ -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. @@ -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. diff --git a/contributing/code/patches.rst b/contributing/code/patches.rst index adba1c5bf9c..9791c24b666 100644 --- a/contributing/code/patches.rst +++ b/contributing/code/patches.rst @@ -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:: diff --git a/contributing/documentation/overview.rst b/contributing/documentation/overview.rst index 3d7056dc19e..dee4e37d570 100644 --- a/contributing/documentation/overview.rst +++ b/contributing/documentation/overview.rst @@ -26,12 +26,12 @@ then clone your fork: $ git clone git://github.com/YOURUSERNAME/symfony-docs.git Consistent with Symfony's source code, the documentation repository is split into -three branches: ``2.0`` for the current Symfony 2.0.x release, ``2.1`` for the -current Symfony 2.1.x release and ``master`` as the development branch for +three branches: ``2.0`` for the current Symfony 2.0.x release, ``2.1`` for the +current Symfony 2.1.x release and ``master`` as the development branch for upcoming releases. Unless you're documenting a feature that's new to Symfony 2.1, your changes -should always be based on the 2.0 branch instead of the master branch. To do +should always be based on the 2.0 branch instead of the master branch. To do this checkout the 2.0 branch before the next step: .. code-block:: bash @@ -52,7 +52,7 @@ the ``symfony-docs`` ``master`` branch. .. image:: /images/docs-pull-request.png :align: center -If you have made your changes based on the 2.0 branch then you need to change +If you have made your changes based on the 2.0 branch then you need to change the base branch to be 2.0 on the preview page: .. image:: /images/docs-pull-request-change-base.png @@ -61,7 +61,7 @@ the base branch to be 2.0 on the preview page: .. note:: All changes made to the 2.0 branch will be merged into 2.1 which in turn will be - merged into the master branch for the next release on a weekly basis. + merged into the master branch for the next release on a weekly basis. GitHub covers the topic of `pull requests`_ in detail. @@ -73,9 +73,9 @@ GitHub covers the topic of `pull requests`_ in detail. .. tip:: Please be patient. It can take from 15 minutes to several days for your changes - to appear on the symfony.com website after the documentation team merges your - pull request. You can check if your changes have introduced some markup issues - by going to the `Documentation Build Errors`_ page (it is updated each French + to appear on the symfony.com website after the documentation team merges your + pull request. You can check if your changes have introduced some markup issues + by going to the `Documentation Build Errors`_ page (it is updated each French night at 3AM when the server rebuilds the documentation). Standards @@ -88,19 +88,19 @@ look and feel familiar, you should follow these rules: as well as the `Twig Coding Standards`_; * Each line should break approximately after the first word that crosses the 72nd character (so most lines end up being 72-78 lines); -* When we fold one or more lines of code, we place ``...`` in a comment at the point +* When you fold one or more lines of code, place ``...`` in a comment at the point of the fold. These comments are: ``// ...`` (php), ``# ...`` (yaml/bash), ``{# ... #}`` (twig), ```` (xml/html), ``; ...`` (ini), ``...`` (text); -* When we fold a part of a line, e.g. a variable value, we put ``...`` (without comment) +* When you fold a part of a line, e.g. a variable value, put ``...`` (without comment) at the place of the fold; * Description of the folded code: (optional) - If we fold several lines: the description of the fold can be placed after the ``...`` - If we fold only part of a line: the description can be placed before the line; + If you fold several lines: the description of the fold can be placed after the ``...`` + If you fold only part of a line: the description can be placed before the line; * If useful, a ``codeblock`` should begin with a comment containing the filename of the file in the code block. Don't place a blank line after this comment, unless the next line is also a comment; * You should put a ``$`` in front of every bash line; -* We prefer the ``::`` shorthand over ``.. code-block:: php`` to begin a PHP +* The ``::`` shorthand is preferred over ``.. code-block:: php`` to begin a PHP code block. An example:: diff --git a/cookbook/console/console_command.rst b/cookbook/console/console_command.rst index 314e0d00ddc..dc6cbd95647 100644 --- a/cookbook/console/console_command.rst +++ b/cookbook/console/console_command.rst @@ -15,7 +15,7 @@ To make the console commands available automatically with Symfony2, create a ``Command`` directory inside your bundle and create a php file suffixed with ``Command.php`` for each command that you want to provide. For example, if you want to extend the ``AcmeDemoBundle`` (available in the Symfony Standard -Edition) to greet us from the command line, create ``GreetCommand.php`` and +Edition) to greet you from the command line, create ``GreetCommand.php`` and add the following to it:: // src/Acme/DemoBundle/Command/GreetCommand.php @@ -93,9 +93,9 @@ should be used instead of :class:`Symfony\\Component\\Console\\Application`:: Getting Services from the Service Container ------------------------------------------- -By using :class:`Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand` -as the base class for the command (instead of the more basic -:class:`Symfony\\Component\\Console\\Command\\Command`), you have access to the +By using :class:`Symfony\\Bundle\\FrameworkBundle\\Command\\ContainerAwareCommand` +as the base class for the command (instead of the more basic +:class:`Symfony\\Component\\Console\\Command\\Command`), you have access to the service container. In other words, you have access to any configured service. For example, you could easily extend the task to be translatable:: diff --git a/cookbook/event_dispatcher/before_after_filters.rst b/cookbook/event_dispatcher/before_after_filters.rst index 7ca34c3013a..bd61d37d2a3 100755 --- a/cookbook/event_dispatcher/before_after_filters.rst +++ b/cookbook/event_dispatcher/before_after_filters.rst @@ -180,7 +180,7 @@ your listener to be called just before any controller is executed. With this configuration, your ``TokenListener`` ``onKernelController`` method will be executed on each request. If the controller that is about to be executed implements ``TokenAuthenticatedController``, token authentication is -applied. This lets us have a "before" filter on any controller that you +applied. This lets you have a "before" filter on any controller that you want. After filters with the ``kernel.response`` Event diff --git a/cookbook/form/dynamic_form_generation.rst b/cookbook/form/dynamic_form_generation.rst index 904ad85f5e8..fa2d0aec552 100644 --- a/cookbook/form/dynamic_form_generation.rst +++ b/cookbook/form/dynamic_form_generation.rst @@ -120,7 +120,7 @@ might look like the following:: // During form creation setData() is called with null as an argument // by the FormBuilder constructor. You're only concerned with when // setData is called with an actual Entity object in it (whether new - // or fetched with Doctrine). This if statement lets us skip right + // or fetched with Doctrine). This if statement lets you skip right // over the null condition. if (null === $data) { return; diff --git a/cookbook/service_container/event_listener.rst b/cookbook/service_container/event_listener.rst index 4ec53df4fcd..1ad40b1106d 100644 --- a/cookbook/service_container/event_listener.rst +++ b/cookbook/service_container/event_listener.rst @@ -11,7 +11,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, 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`` +you to modify how exceptions are shown by our application. The ``KernelEvents::EXCEPTION`` event is just one of the core kernel events:: // src/Acme/DemoBundle/Listener/AcmeExceptionListener.php diff --git a/quick_tour/the_architecture.rst b/quick_tour/the_architecture.rst index 21db8c2520c..4a7668bab32 100644 --- a/quick_tour/the_architecture.rst +++ b/quick_tour/the_architecture.rst @@ -147,7 +147,7 @@ a single ``Bundle`` class that describes it:: return $bundles; } -In addition to the ``AcmeDemoBundle`` that we have already talked about, notice +In addition to the ``AcmeDemoBundle`` that was already talked about, notice that the kernel also enables other bundles such as the ``FrameworkBundle``, ``DoctrineBundle``, ``SwiftmailerBundle``, and ``AsseticBundle`` bundle. They are all part of the core framework. @@ -297,8 +297,8 @@ If you follow these conventions, then you can use :doc:`bundle inheritanceredirect($this->generateUrl('_demo_hello', array('name' => 'Lucas'))); -The ``generateUrl()`` is the same method as the ``path()`` function we used in +The ``generateUrl()`` is the same method as the ``path()`` function used in the templates. It takes the route name and an array of parameters as arguments and returns the associated friendly URL. @@ -257,8 +257,8 @@ In this example, the resource will be cached for a day. But you can also use validation instead of expiration or a combination of both if that fits your needs better. -Resource caching is managed by the Symfony2 built-in reverse proxy. But because -caching is managed using regular HTTP cache headers, you can replace the +Resource caching is managed by the Symfony2 built-in reverse proxy. But because +caching is managed using regular HTTP cache headers, you can replace the built-in reverse proxy with Varnish or Squid and easily scale your application. .. note:: @@ -270,8 +270,8 @@ built-in reverse proxy with Varnish or Squid and easily scale your application. Final Thoughts -------------- -That's all there is to it, and I'm not even sure we have spent the full -10 minutes. We briefly introduced bundles in the first part, and all the -features we've learned about so far are part of the core framework bundle. +That's all there is to it, and I'm not even sure you'll have spent the full +10 minutes. You were briefly introduced to bundles in the first part, and all the +features you've learned about so far are part of the core framework bundle. But thanks to bundles, everything in Symfony2 can be extended or replaced. That's the topic of the :doc:`next part of this tutorial`. diff --git a/quick_tour/the_view.rst b/quick_tour/the_view.rst index cc1449d3145..26b01254946 100644 --- a/quick_tour/the_view.rst +++ b/quick_tour/the_view.rst @@ -17,7 +17,7 @@ Getting familiar with Twig .. tip:: - If you want to learn Twig, we highly recommend you to read its official + If you want to learn Twig, it's highly recommended you read its official `documentation`_. This section is just a quick overview of the main concepts. @@ -98,7 +98,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. This works exactly the same as PHP classes: template inheritance allows you to build a base "layout" template that contains all the common elements of your site and diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 9f53dcbb4ea..df0f8fc401b 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -226,8 +226,8 @@ would be ``/images/logo.png?version=5``. is not limited to producing versioned query strings. The pattern receives the asset's original path and version as its first and - second parameters, respectively. Since the asset's path is one parameter, we - cannot modify it in-place (e.g. ``/images/logo-v5.png``); however, we can + second parameters, respectively. Since the asset's path is one parameter, you + cannot modify it in-place (e.g. ``/images/logo-v5.png``); however, you can prefix the asset's path using a pattern of ``version-%%2$s/%%1$s``, which would result in the path ``version-5/images/logo.png``. diff --git a/reference/constraints/Valid.rst b/reference/constraints/Valid.rst index d634d527aef..e14d4077bac 100644 --- a/reference/constraints/Valid.rst +++ b/reference/constraints/Valid.rst @@ -16,7 +16,7 @@ object and all sub-objects associated with it. Basic Usage ----------- -In the following example, we create two classes ``Author`` and ``Address`` +In the following example, you create two classes ``Author`` and ``Address`` that both have constraints on their properties. Furthermore, ``Author`` stores an ``Address`` instance in the ``$address`` property. @@ -115,7 +115,7 @@ an ``Address`` instance in the ``$address`` property. * @Assert\NotBlank */ protected $lastName; - + protected $address; } @@ -125,13 +125,13 @@ an ``Address`` instance in the ``$address`` property. use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\MaxLength; - + class Address { protected $street; protected $zipCode; - + public static function loadValidatorMetadata(ClassMetadata $metadata) { $metadata->addPropertyConstraint('street', new NotBlank()); @@ -144,15 +144,15 @@ an ``Address`` instance in the ``$address`` property. use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\MinLength; - + class Author { protected $firstName; protected $lastName; - + protected $address; - + public static function loadValidatorMetadata(ClassMetadata $metadata) { $metadata->addPropertyConstraint('firstName', new NotBlank()); @@ -192,7 +192,7 @@ property. class Author { /* ... */ - + /** * @Assert\Valid */ @@ -204,11 +204,11 @@ property. // src/Acme/HelloBundle/Author.php use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Constraints\Valid; - + class Author { protected $address; - + public static function loadValidatorMetadata(ClassMetadata $metadata) { $metadata->addPropertyConstraint('address', new Valid()); diff --git a/reference/forms/types/collection.rst b/reference/forms/types/collection.rst index 9c69bc82903..dd2fca2d3df 100644 --- a/reference/forms/types/collection.rst +++ b/reference/forms/types/collection.rst @@ -51,11 +51,11 @@ The simplest way to render this is all at once: .. configuration-block:: .. code-block:: jinja - + {{ form_row(form.emails) }} .. code-block:: php - + row($form['emails']) ?> A much more flexible method would look like this: @@ -63,7 +63,7 @@ A much more flexible method would look like this: .. configuration-block:: .. code-block:: html+jinja - + {{ form_label(form.emails) }} {{ form_errors(form.emails) }} @@ -80,7 +80,7 @@ A much more flexible method would look like this: label($form['emails']) ?> errors($form['emails']) ?> - +
  • @@ -141,7 +141,7 @@ you need is the JavaScript: .. configuration-block:: .. code-block:: html+jinja - +
    {# ... #} @@ -154,9 +154,9 @@ you need is the JavaScript:
  • {% endfor %}
- + Add another email - + {# ... #} @@ -191,7 +191,7 @@ you need is the JavaScript: is automatically available on the ``data-prototype`` attribute of the element (e.g. ``div`` or ``table``) that surrounds your collection. The only difference is that the entire "form row" is rendered for you, meaning - you wouldn't have to wrap it in any container element like we've done + you wouldn't have to wrap it in any container element as was done above. Field Options @@ -294,11 +294,11 @@ collection field: .. configuration-block:: .. code-block:: jinja - + {{ form_row(form.emails.vars.prototype) }} .. code-block:: php - + row($form['emails']->get('prototype')) ?> Note that all you really need is the "widget", but depending on how you're @@ -330,4 +330,4 @@ error_bubbling .. _reference-form-types-by-reference: -.. include:: /reference/forms/types/options/by_reference.rst.inc \ No newline at end of file +.. include:: /reference/forms/types/options/by_reference.rst.inc diff --git a/reference/forms/types/options/by_reference.rst.inc b/reference/forms/types/options/by_reference.rst.inc index 6c0f55f5648..0157ac50417 100644 --- a/reference/forms/types/options/by_reference.rst.inc +++ b/reference/forms/types/options/by_reference.rst.inc @@ -8,7 +8,7 @@ to be called on the underlying object. In some cases, however, ``setName`` may *not* be called. Setting ``by_reference`` ensures that the setter is called in all cases. -To understand this further, let's look at a simple example:: +To explain this further, here's a simple example:: $builder = $this->createFormBuilder($article); $builder @@ -28,7 +28,7 @@ when you call ``bindRequest`` on the form:: Notice that ``setAuthor`` is not called. The author is modified by reference. -If we set ``by_reference`` to false, binding looks like this:: +If you set ``by_reference`` to false, binding looks like this:: $article->setTitle('...'); $author = $article->getAuthor(); @@ -42,4 +42,4 @@ call the setter on the parent object. Similarly, if you're using the :doc:`collection` form type where your underlying collection data is an object (like with Doctrine's ``ArrayCollection``), then ``by_reference`` must be set to ``false`` if you -need the setter (e.g. ``setAuthors``) to be called. \ No newline at end of file +need the setter (e.g. ``setAuthors``) to be called. From 3cc3874606b2a8a834a26b25ad84cd9d69995c70 Mon Sep 17 00:00:00 2001 From: Jon Gotlin Date: Tue, 20 Nov 2012 09:41:59 +0100 Subject: [PATCH 14/34] Fixed syntax error. --- book/translation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/translation.rst b/book/translation.rst index d7211925fd5..76456f0f868 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -789,7 +789,7 @@ locale to use for translation:: 'Symfony2 is great', array(), 'messages', - 'fr_FR', + 'fr_FR' ); $this->get('translator')->transChoice( @@ -797,7 +797,7 @@ locale to use for translation:: 10, array('%count%' => 10), 'messages', - 'fr_FR', + 'fr_FR' ); Translating Database Content From 8763e6142f2524f40f40a69f7b0e4a19fc69a218 Mon Sep 17 00:00:00 2001 From: Thomas Ploch Date: Wed, 21 Nov 2012 16:28:25 +0100 Subject: [PATCH 15/34] Added example of non standard 'X-Requested-With' HTTP header. This example is giving an example on how to add a non standard header, and as well reminding the user to add a 'HTTP_' prefix, so the custom header gets sent. --- book/testing.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/book/testing.rst b/book/testing.rst index 6972af66b80..ea658d57e5f 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -235,8 +235,9 @@ 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', @@ -244,8 +245,9 @@ document:: array(), array(), array( - 'CONTENT_TYPE' => 'application/json', - 'HTTP_REFERER' => '/foo/bar', + 'CONTENT_TYPE' => 'application/json', + 'HTTP_REFERER' => '/foo/bar', + 'HTTP_X-Requested-With' => 'XMLHttpRequest' ) ); From 7a1c6942d957aef4f8a8c25c80deac73fb57704e Mon Sep 17 00:00:00 2001 From: Thomas Ploch Date: Wed, 21 Nov 2012 17:57:51 +0100 Subject: [PATCH 16/34] Added missing ',' to example code array. --- book/testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/testing.rst b/book/testing.rst index ea658d57e5f..51a2e8a08f6 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -247,7 +247,7 @@ document:: array( 'CONTENT_TYPE' => 'application/json', 'HTTP_REFERER' => '/foo/bar', - 'HTTP_X-Requested-With' => 'XMLHttpRequest' + 'HTTP_X-Requested-With' => 'XMLHttpRequest', ) ); From 804f2f2d05d3a3425192c9beedd165096a015071 Mon Sep 17 00:00:00 2001 From: Wouter J Date: Sun, 11 Nov 2012 15:11:10 +0100 Subject: [PATCH 17/34] Added information about coloring with tags --- components/console/introduction.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/console/introduction.rst b/components/console/introduction.rst index b5600a63e07..62c25583830 100755 --- a/components/console/introduction.rst +++ b/components/console/introduction.rst @@ -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('foo'); + + // black text on a cyan background + $output->writeln('foo'); + + // bold text on a yellow background + $output->writeln('foo'); + + Using Command Arguments ----------------------- From 12527cbcf1bbde5d4582fb8a293de5c2f855dbc0 Mon Sep 17 00:00:00 2001 From: Denis Gorbachev Date: Thu, 15 Nov 2012 19:45:00 +0400 Subject: [PATCH 18/34] Remove trailing slashes from directory names --- cookbook/configuration/override_dir_structure.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/configuration/override_dir_structure.rst b/cookbook/configuration/override_dir_structure.rst index 90601930976..804d94761a5 100644 --- a/cookbook/configuration/override_dir_structure.rst +++ b/cookbook/configuration/override_dir_structure.rst @@ -38,7 +38,7 @@ in the ``AppKernel`` class of you application:: public function getCacheDir() { - return $this->rootDir.'/'.$this->environment.'/cache/'; + return $this->rootDir.'/'.$this->environment.'/cache'; } } @@ -69,7 +69,7 @@ method:: public function getLogDir() { - return $this->rootDir.'/'.$this->environment.'/logs/'; + return $this->rootDir.'/'.$this->environment.'/logs'; } } From 3f223babe404573d5b04a1559f6a05f9630e8b70 Mon Sep 17 00:00:00 2001 From: David Desberg Date: Thu, 15 Nov 2012 11:54:05 -0500 Subject: [PATCH 19/34] Added MSSQL example for PDO session storage table --- cookbook/configuration/pdo_session_storage.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cookbook/configuration/pdo_session_storage.rst b/cookbook/configuration/pdo_session_storage.rst index 43a12b89c59..1a41650ffcb 100644 --- a/cookbook/configuration/pdo_session_storage.rst +++ b/cookbook/configuration/pdo_session_storage.rst @@ -182,3 +182,20 @@ For PostgreSQL, the statement should look like this: session_time integer NOT NULL, CONSTRAINT session_pkey PRIMARY KEY (session_id) ); + +Microsoft SQL Server +~~~~~~~~~~ + +For MSSQL, the statement might look like the following: + +.. code-block:: sql + + CREATE TABLE [dbo].[session]( + [session_id] [nvarchar](255) NOT NULL, + [session_value] [ntext] NOT NULL, + [session_time] [int] NOT NULL, + PRIMARY KEY CLUSTERED + ( + [session_id] ASC + ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] From 3e47f1bf5737e30002835e6d85ad552062526c19 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 23 Nov 2012 09:24:01 -0500 Subject: [PATCH 20/34] [#1926] Tweaking MSSQL code example --- cookbook/configuration/pdo_session_storage.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cookbook/configuration/pdo_session_storage.rst b/cookbook/configuration/pdo_session_storage.rst index 1a41650ffcb..8b38335dd35 100644 --- a/cookbook/configuration/pdo_session_storage.rst +++ b/cookbook/configuration/pdo_session_storage.rst @@ -184,7 +184,7 @@ For PostgreSQL, the statement should look like this: ); Microsoft SQL Server -~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~ For MSSQL, the statement might look like the following: @@ -197,5 +197,11 @@ For MSSQL, the statement might look like the following: PRIMARY KEY CLUSTERED ( [session_id] ASC - ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + ) WITH ( + PAD_INDEX = OFF, + STATISTICS_NORECOMPUTE = OFF, + IGNORE_DUP_KEY = OFF, + ALLOW_ROW_LOCKS = ON, + ALLOW_PAGE_LOCKS = ON + ) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] From 79e023cbedf59bc012bad75f692f2ea7684c4209 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 23 Nov 2012 09:28:14 -0500 Subject: [PATCH 21/34] [#1926] Fixing some spacing in code block --- cookbook/configuration/pdo_session_storage.rst | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cookbook/configuration/pdo_session_storage.rst b/cookbook/configuration/pdo_session_storage.rst index 8b38335dd35..b4123b275f5 100644 --- a/cookbook/configuration/pdo_session_storage.rst +++ b/cookbook/configuration/pdo_session_storage.rst @@ -190,12 +190,11 @@ For MSSQL, the statement might look like the following: .. code-block:: sql - CREATE TABLE [dbo].[session]( - [session_id] [nvarchar](255) NOT NULL, - [session_value] [ntext] NOT NULL, - [session_time] [int] NOT NULL, - PRIMARY KEY CLUSTERED - ( + CREATE TABLE [dbo].[session]( + [session_id] [nvarchar](255) NOT NULL, + [session_value] [ntext] NOT NULL, + [session_time] [int] NOT NULL, + PRIMARY KEY CLUSTERED( [session_id] ASC ) WITH ( PAD_INDEX = OFF, @@ -204,4 +203,4 @@ For MSSQL, the statement might look like the following: ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON ) ON [PRIMARY] - ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] + ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] From 166e6894812e98f765a29aa2e312af4ac4da59ac Mon Sep 17 00:00:00 2001 From: Thomas Tourlourat Date: Fri, 16 Nov 2012 11:15:03 +0100 Subject: [PATCH 22/34] Use best practices naming http://symfony.com/doc/2.1/cookbook/bundles/best_practices.html --- cookbook/form/create_custom_field_type.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/form/create_custom_field_type.rst b/cookbook/form/create_custom_field_type.rst index 9a7f10e3c64..5274024c2c2 100644 --- a/cookbook/form/create_custom_field_type.rst +++ b/cookbook/form/create_custom_field_type.rst @@ -204,7 +204,7 @@ the ``genders`` parameter value as the first argument to its to-be-created # src/Acme/DemoBundle/Resources/config/services.yml services: - form.type.gender: + acme_demo.form.type.gender: class: Acme\DemoBundle\Form\Type\GenderType arguments: - "%genders%" @@ -214,7 +214,7 @@ the ``genders`` parameter value as the first argument to its to-be-created .. code-block:: xml - + %genders% From de1c7986defc69f7abf9fb7415d7fb88a4b89402 Mon Sep 17 00:00:00 2001 From: Pascal Borreli Date: Fri, 16 Nov 2012 14:00:58 +0000 Subject: [PATCH 23/34] Fixed typos --- components/dependency_injection/definitions.rst | 2 +- components/filesystem.rst | 2 +- components/http_foundation/sessions.rst | 2 +- cookbook/doctrine/file_uploads.rst | 2 +- cookbook/logging/monolog_email.rst | 2 +- cookbook/service_container/scopes.rst | 2 +- reference/configuration/doctrine.rst | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/components/dependency_injection/definitions.rst b/components/dependency_injection/definitions.rst index 6d5342a1b4d..af551df6a34 100644 --- a/components/dependency_injection/definitions.rst +++ b/components/dependency_injection/definitions.rst @@ -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; diff --git a/components/filesystem.rst b/components/filesystem.rst index 21d93946448..c3d113b8e7b 100644 --- a/components/filesystem.rst +++ b/components/filesystem.rst @@ -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:: diff --git a/components/http_foundation/sessions.rst b/components/http_foundation/sessions.rst index b0a93459705..533abfa2c3f 100644 --- a/components/http_foundation/sessions.rst +++ b/components/http_foundation/sessions.rst @@ -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. diff --git a/cookbook/doctrine/file_uploads.rst b/cookbook/doctrine/file_uploads.rst index 421e64bdc08..4124d2153a1 100644 --- a/cookbook/doctrine/file_uploads.rst +++ b/cookbook/doctrine/file_uploads.rst @@ -216,7 +216,7 @@ object, which is what's returned after a ``file`` field is submitted:: // move takes the target directory and then the target filename to move to $this->file->move($this->getUploadRootDir(), $this->file->getClientOriginalName()); - // set the path property to the filename where you'ved saved the file + // set the path property to the filename where you've saved the file $this->path = $this->file->getClientOriginalName(); // clean up the file property as you won't need it anymore diff --git a/cookbook/logging/monolog_email.rst b/cookbook/logging/monolog_email.rst index e5fb5680513..330d4a3de60 100644 --- a/cookbook/logging/monolog_email.rst +++ b/cookbook/logging/monolog_email.rst @@ -1,5 +1,5 @@ .. index:: - single: Logging; Emailling errors + single: Logging; Emailing errors How to Configure Monolog to Email Errors ======================================== diff --git a/cookbook/service_container/scopes.rst b/cookbook/service_container/scopes.rst index 7da0e98254f..2eea3583f04 100644 --- a/cookbook/service_container/scopes.rst +++ b/cookbook/service_container/scopes.rst @@ -35,7 +35,7 @@ when compiling the container. Read the sidebar below for more details. Imagine you've configured a `my_mailer` service. You haven't configured 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 + every time 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` diff --git a/reference/configuration/doctrine.rst b/reference/configuration/doctrine.rst index 7929b2ce176..42c3b7b28d3 100644 --- a/reference/configuration/doctrine.rst +++ b/reference/configuration/doctrine.rst @@ -40,7 +40,7 @@ Configuration Reference # True to use as persistent connection for the ibm_db2 driver persistent: ~ - # The protocol to use for the ibm_db2 driver (default to TCPIP if ommited) + # The protocol to use for the ibm_db2 driver (default to TCPIP if omitted) protocol: ~ # True to use dbname as service name instead of SID for Oracle @@ -85,7 +85,7 @@ Configuration Reference # True to use as persistent connection for the ibm_db2 driver persistent: ~ - # The protocol to use for the ibm_db2 driver (default to TCPIP if ommited) + # The protocol to use for the ibm_db2 driver (default to TCPIP if omitted) protocol: ~ # True to use dbname as service name instead of SID for Oracle From 600b5e7808d2490f8f4bfde2f76f574df5afa744 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 23 Nov 2012 09:42:59 -0500 Subject: [PATCH 24/34] [#1930] Backporting changes made by @pborreli --- components/dependency_injection/definitions.rst | 2 +- cookbook/doctrine/file_uploads.rst | 2 +- cookbook/logging/monolog_email.rst | 2 +- cookbook/service_container/scopes.rst | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/dependency_injection/definitions.rst b/components/dependency_injection/definitions.rst index 6d5342a1b4d..af551df6a34 100644 --- a/components/dependency_injection/definitions.rst +++ b/components/dependency_injection/definitions.rst @@ -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; diff --git a/cookbook/doctrine/file_uploads.rst b/cookbook/doctrine/file_uploads.rst index abb042bbd4a..f23ab3cf57c 100644 --- a/cookbook/doctrine/file_uploads.rst +++ b/cookbook/doctrine/file_uploads.rst @@ -216,7 +216,7 @@ object, which is what's returned after a ``file`` field is submitted:: // move takes the target directory and then the target filename to move to $this->file->move($this->getUploadRootDir(), $this->file->getClientOriginalName()); - // set the path property to the filename where you'ved saved the file + // set the path property to the filename where you've saved the file $this->path = $this->file->getClientOriginalName(); // clean up the file property as you won't need it anymore diff --git a/cookbook/logging/monolog_email.rst b/cookbook/logging/monolog_email.rst index e5fb5680513..330d4a3de60 100644 --- a/cookbook/logging/monolog_email.rst +++ b/cookbook/logging/monolog_email.rst @@ -1,5 +1,5 @@ .. index:: - single: Logging; Emailling errors + single: Logging; Emailing errors How to Configure Monolog to Email Errors ======================================== diff --git a/cookbook/service_container/scopes.rst b/cookbook/service_container/scopes.rst index 7da0e98254f..2eea3583f04 100644 --- a/cookbook/service_container/scopes.rst +++ b/cookbook/service_container/scopes.rst @@ -35,7 +35,7 @@ when compiling the container. Read the sidebar below for more details. Imagine you've configured a `my_mailer` service. You haven't configured 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 + every time 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` From acb42f74a3114c148b2ac97ac61fb6cbf64b0e6c Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 23 Nov 2012 09:57:48 -0500 Subject: [PATCH 25/34] [#1935] Making note about --prefer-dist shorter in the installation chapter --- book/installation.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/book/installation.rst b/book/installation.rst index a04e0916350..9560cef55bf 100644 --- a/book/installation.rst +++ b/book/installation.rst @@ -68,10 +68,10 @@ Distribution: (e.g. 2.1.1). For details, see the `Symfony Installation Page`_ .. tip:: - If you don't want to have the "Tests" directories in your sources when using - Composer, you'll need to add the "--prefer-dist" option at the end of any - command and it will skip those directories from the listing. Here you can view - more information about `light-weight distribution packages` and Composer. + + 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, @@ -329,4 +329,3 @@ install all the necessary project dependencies. .. _`Apache`: http://httpd.apache.org/docs/current/mod/core.html#documentroot .. _`Nginx`: http://wiki.nginx.org/Symfony .. _`Symfony Installation Page`: http://symfony.com/download -.. _`light-weight distribution packages`: http://getcomposer.org/doc/02-libraries.md#light-weight-distribution-packages From 25a0f40d862430842a646dacf22a8e38d64f685d Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 23 Nov 2012 10:16:24 -0500 Subject: [PATCH 26/34] [#1937] Small tweaks in changes out of first person language --- book/controller.rst | 2 +- book/doctrine.rst | 4 ++-- book/forms.rst | 2 +- book/installation.rst | 2 +- components/console/introduction.rst | 2 +- quick_tour/the_view.rst | 2 +- reference/constraints/Valid.rst | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/book/controller.rst b/book/controller.rst index 2d3f2ec6561..273799255b4 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -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. -See how simple this is, by looking 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; diff --git a/book/doctrine.rst b/book/doctrine.rst index 6caaeefd7b4..8dde967b0ca 100644 --- a/book/doctrine.rst +++ b/book/doctrine.rst @@ -418,7 +418,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. -Walking 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. @@ -963,7 +963,7 @@ table, and ``product.category_id`` column, and new foreign key: Saving Related Entities ~~~~~~~~~~~~~~~~~~~~~~~ -Now, to 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:: // ... diff --git a/book/forms.rst b/book/forms.rst index c2214b52293..471ac5e551c 100644 --- a/book/forms.rst +++ b/book/forms.rst @@ -576,7 +576,7 @@ of code. Of course, you'll usually need much more flexibility when rendering: -Taking 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"``; diff --git a/book/installation.rst b/book/installation.rst index 417baf1b6d2..24f3b3610b8 100644 --- a/book/installation.rst +++ b/book/installation.rst @@ -188,7 +188,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, look at ":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. diff --git a/components/console/introduction.rst b/components/console/introduction.rst index 6a77cd7c36d..47313027092 100755 --- a/components/console/introduction.rst +++ b/components/console/introduction.rst @@ -23,7 +23,7 @@ You can install the component in many different ways: Creating a basic Command ------------------------ -To make a console command to greet you 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; diff --git a/quick_tour/the_view.rst b/quick_tour/the_view.rst index 26b01254946..6fb4ea22257 100644 --- a/quick_tour/the_view.rst +++ b/quick_tour/the_view.rst @@ -98,7 +98,7 @@ Decorating Templates -------------------- More often than not, templates in a project share common elements, like the -well-known header and footer. In Symfony2, this problem is thought about +well-known header and footer. In Symfony2, you think about this problem differently: a template can be decorated by another one. This works exactly the same as PHP classes: template inheritance allows you to build a base "layout" template that contains all the common elements of your site and diff --git a/reference/constraints/Valid.rst b/reference/constraints/Valid.rst index e14d4077bac..a0d88b14399 100644 --- a/reference/constraints/Valid.rst +++ b/reference/constraints/Valid.rst @@ -16,7 +16,7 @@ object and all sub-objects associated with it. Basic Usage ----------- -In the following example, you create two classes ``Author`` and ``Address`` +In the following example, create two classes ``Author`` and ``Address`` that both have constraints on their properties. Furthermore, ``Author`` stores an ``Address`` instance in the ``$address`` property. From 3bc2b78857531c9e5251bcf998e33b389b39f051 Mon Sep 17 00:00:00 2001 From: Wouter J Date: Mon, 19 Nov 2012 17:39:37 +0100 Subject: [PATCH 27/34] Added some standards --- contributing/documentation/overview.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contributing/documentation/overview.rst b/contributing/documentation/overview.rst index dee4e37d570..87dd52c82f9 100644 --- a/contributing/documentation/overview.rst +++ b/contributing/documentation/overview.rst @@ -88,6 +88,8 @@ look and feel familiar, you should follow these rules: as well as the `Twig Coding Standards`_; * Each line should break approximately after the first word that crosses the 72nd character (so most lines end up being 72-78 lines); +* To avoid horizontal scrolling on code blocks, we prefer to break a line + correctly if it crosses the 85th character; * When you fold one or more lines of code, place ``...`` in a comment at the point of the fold. These comments are: ``// ...`` (php), ``# ...`` (yaml/bash), ``{# ... #}`` (twig), ```` (xml/html), ``; ...`` (ini), ``...`` (text); @@ -101,7 +103,8 @@ look and feel familiar, you should follow these rules: unless the next line is also a comment; * You should put a ``$`` in front of every bash line; * The ``::`` shorthand is preferred over ``.. code-block:: php`` to begin a PHP - code block. + code block; +* You should use a form of *you* instead of *we*. An example:: From c01bc9d8f13e8ba986dcfcc6f80955ba5e1d0d31 Mon Sep 17 00:00:00 2001 From: Massimiliano Arione Date: Tue, 20 Nov 2012 09:24:39 +0100 Subject: [PATCH 28/34] Update components/http_foundation/introduction.rst fixed a bad copy&paste --- components/http_foundation/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/http_foundation/introduction.rst b/components/http_foundation/introduction.rst index dd44da5fc69..d4e7b1454fc 100644 --- a/components/http_foundation/introduction.rst +++ b/components/http_foundation/introduction.rst @@ -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; Accessing other Data ~~~~~~~~~~~~~~~~~~~~ From 820f90c37e824e0dfbe698dc621f370cfdc5bbf3 Mon Sep 17 00:00:00 2001 From: Eriksen Costa Date: Wed, 21 Nov 2012 01:59:42 -0200 Subject: [PATCH 29/34] typo --- cookbook/configuration/external_parameters.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/configuration/external_parameters.rst b/cookbook/configuration/external_parameters.rst index 00a784b7daa..4484d9f9762 100644 --- a/cookbook/configuration/external_parameters.rst +++ b/cookbook/configuration/external_parameters.rst @@ -7,7 +7,7 @@ How to Set External Parameters in the Service Container In the chapter :doc:`/cookbook/configuration/environments`, you learned how to manage your application configuration. At times, it may benefit your application to store certain credentials outside of your project code. Database configuration -is one such example. The flexibility of the symfony service container allows +is one such example. The flexibility of the Symfony service container allows you to easily do this. Environment Variables From f586d799e08c17b302215fd15006ef3a9ea21ec3 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 23 Nov 2012 10:44:06 -0500 Subject: [PATCH 30/34] Fixing references to lowercase symfony --- book/from_flat_php_to_symfony2.rst | 4 ++-- components/dependency_injection/advanced.rst | 2 +- cookbook/configuration/external_parameters.rst | 2 +- cookbook/routing/slash_in_parameter.rst | 2 +- cookbook/workflow/new_project_svn.rst | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/book/from_flat_php_to_symfony2.rst b/book/from_flat_php_to_symfony2.rst index aed3fca5bf6..f9ad97ee141 100644 --- a/book/from_flat_php_to_symfony2.rst +++ b/book/from_flat_php_to_symfony2.rst @@ -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/`` directory. +First, `download Symfony`_ and place it into a ``vendor/symfony/`` directory. Next, create an ``app/bootstrap.php`` file. Use it to ``require`` the two files in the application and to configure the autoloader: @@ -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/ diff --git a/components/dependency_injection/advanced.rst b/components/dependency_injection/advanced.rst index 5c9eafd21e4..31920781b0a 100644 --- a/components/dependency_injection/advanced.rst +++ b/components/dependency_injection/advanced.rst @@ -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. diff --git a/cookbook/configuration/external_parameters.rst b/cookbook/configuration/external_parameters.rst index 4484d9f9762..6a9c83ac03f 100644 --- a/cookbook/configuration/external_parameters.rst +++ b/cookbook/configuration/external_parameters.rst @@ -158,7 +158,7 @@ in the container. The following imports a file named ``parameters.php``. In ``parameters.php``, tell the service container the parameters that you wish to set. This is useful when important configuration is in a nonstandard format. The example below includes a Drupal database's configuration in -the symfony service container. +the Symfony service container. .. code-block:: php diff --git a/cookbook/routing/slash_in_parameter.rst b/cookbook/routing/slash_in_parameter.rst index 6be094cef20..0c371f5e7ff 100644 --- a/cookbook/routing/slash_in_parameter.rst +++ b/cookbook/routing/slash_in_parameter.rst @@ -15,7 +15,7 @@ matches the ``/hello/{name}`` route, where ``{name}`` equals ``Fabien/Kris``. Configure the Route ------------------- -By default, the symfony routing components requires that the parameters +By default, the Symfony routing components requires that the parameters match the following regex pattern: ``[^/]+``. This means that all characters are allowed except ``/``. diff --git a/cookbook/workflow/new_project_svn.rst b/cookbook/workflow/new_project_svn.rst index e3aeed94a63..a55df4fac93 100644 --- a/cookbook/workflow/new_project_svn.rst +++ b/cookbook/workflow/new_project_svn.rst @@ -84,7 +84,7 @@ To get started, you'll need to download Symfony2 and get the basic Subversion se $ svn propset svn:ignore "bundles" web - $ svn ci -m "commit basic symfony ignore list (vendor, app/bootstrap*, app/config/parameters.ini, app/cache/*, app/logs/*, web/bundles)" + $ svn ci -m "commit basic Symfony ignore list (vendor, app/bootstrap*, app/config/parameters.ini, app/cache/*, app/logs/*, web/bundles)" 6. The rest of the files can now be added and committed to the project: From 619fac02ba6413ba4ca41da066658ad72632679e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Brikou=20Carr=C3=A9?= Date: Fri, 23 Nov 2012 15:47:54 +0100 Subject: [PATCH 31/34] added tearDown method and freeing entity manager --- cookbook/testing/doctrine.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cookbook/testing/doctrine.rst b/cookbook/testing/doctrine.rst index f4c7e03d6fc..fbffdac09b7 100644 --- a/cookbook/testing/doctrine.rst +++ b/cookbook/testing/doctrine.rst @@ -32,11 +32,14 @@ which makes all of this quite easy:: */ private $em; + /** + * {@inheritDoc} + */ public function setUp() { static::$kernel = static::createKernel(); static::$kernel->boot(); - $this->em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager'); + $this->em = static::$kernel->getContainer()->get('doctrine')->getEntityManager(); } public function testSearchByCategoryName() @@ -48,4 +51,13 @@ which makes all of this quite easy:: $this->assertCount(1, $products); } + + /** + * {@inheritDoc} + */ + protected function tearDown() + { + parent::tearDown(); + $this->em->close(); + } } From a3fd21af54b34f1cc1f17a33467c89b28c47670f Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 23 Nov 2012 11:08:48 -0500 Subject: [PATCH 32/34] [#1952] Changing to getManager for Doctrine --- cookbook/testing/doctrine.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/testing/doctrine.rst b/cookbook/testing/doctrine.rst index fbffdac09b7..239ee3e8cdb 100644 --- a/cookbook/testing/doctrine.rst +++ b/cookbook/testing/doctrine.rst @@ -39,7 +39,7 @@ which makes all of this quite easy:: { static::$kernel = static::createKernel(); static::$kernel->boot(); - $this->em = static::$kernel->getContainer()->get('doctrine')->getEntityManager(); + $this->em = static::$kernel->getContainer()->get('doctrine')->getManager(); } public function testSearchByCategoryName() From 40e34d4eee3791c37080227462e07fe3926aacc7 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 23 Nov 2012 11:15:32 -0500 Subject: [PATCH 33/34] [#1916] Removing some code that is new in 2.1 - should not be in the 2.0 branch --- cookbook/console/generating_urls.rst | 37 ---------------------------- 1 file changed, 37 deletions(-) diff --git a/cookbook/console/generating_urls.rst b/cookbook/console/generating_urls.rst index 1e3ef5ee0dc..00433d514cd 100644 --- a/cookbook/console/generating_urls.rst +++ b/cookbook/console/generating_urls.rst @@ -16,43 +16,6 @@ what URL it should use when generating URLs. There are two ways of configuring the request context: at the application level and per Command. -Configuring the Request Context globally ----------------------------------------- - -To configure the Request Context - which is used by the URL Generator - you can -redefine the parameters it uses as default values to change the default host -(localhost) and scheme (http). Note that this does not impact URLs generated -via normal web requests, since those will override the defaults. - -.. configuration-block:: - - .. code-block:: yaml - - # app/config/parameters.yml - parameters: - router.request_context.host: example.org - router.request_context.scheme: https - - .. code-block:: xml - - - - - - - - example.org - https - - - - .. code-block:: php - - // app/config/config_test.php - $container->setParameter('router.request_context.host', 'example.org'); - $container->setParameter('router.request_context.scheme', 'https'); - Configuring the Request Context per Command ------------------------------------------- From 40c83db01d83b7d63014c708b126bf6c2be152bd Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Fri, 23 Nov 2012 11:16:31 -0500 Subject: [PATCH 34/34] [#1916] Adding back details that are new in 2.1 - partially taken from @dbu --- cookbook/console/generating_urls.rst | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/cookbook/console/generating_urls.rst b/cookbook/console/generating_urls.rst index 00433d514cd..11c009d9fa3 100644 --- a/cookbook/console/generating_urls.rst +++ b/cookbook/console/generating_urls.rst @@ -16,6 +16,46 @@ what URL it should use when generating URLs. There are two ways of configuring the request context: at the application level and per Command. +Configuring the Request Context globally +---------------------------------------- + +.. versionadded:: 2.1 + The host and scheme parameters are available since Symfony 2.1 + +To configure the Request Context - which is used by the URL Generator - you can +redefine the parameters it uses as default values to change the default host +(localhost) and scheme (http). Note that this does not impact URLs generated +via normal web requests, since those will override the defaults. + +.. configuration-block:: + + .. code-block:: yaml + + # app/config/parameters.yml + parameters: + router.request_context.host: example.org + router.request_context.scheme: https + + .. code-block:: xml + + + + + + + + example.org + https + + + + .. code-block:: php + + // app/config/config_test.php + $container->setParameter('router.request_context.host', 'example.org'); + $container->setParameter('router.request_context.scheme', 'https'); + Configuring the Request Context per Command -------------------------------------------