Skip to content

Commit

Permalink
Merge branch '2.8' into 3.0
Browse files Browse the repository at this point in the history
* 2.8:
  [#6228] backport to the 2.3 branch
  Update form_collections.rst
  removed unnecesary exception form repository
  Replace references of PSR-0 with PSR-4
  change translation getMessages() to getCatalogue()
  Update testing.rst
  add versionadded directive for range type
  Typo in default session save_path
  [book] fixes typo about redirect status codes in the controller chapter.
  Update major_version.rst
  • Loading branch information
xabbuh committed Feb 6, 2016
2 parents 06c76aa + 0d92394 commit f42057a
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ If you want to redirect the user to another page, use the ``redirectToRoute()``
return $this->redirectToRoute('homepage');

// redirectToRoute is equivalent to using redirect() and generateUrl() together:
// return $this->redirect($this->generateUrl('homepage'), 301);
// return $this->redirect($this->generateUrl('homepage'));
}

Or, if you want to redirect externally, just use ``redirect()`` and pass it the URL::
Expand Down
2 changes: 1 addition & 1 deletion book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ section:
Learn more
----------

* The :doc:`chapter about tests in the Symfony Framework Best Practices </best_practices/tests>`
* :doc:`The chapter about tests in the Symfony Framework Best Practices </best_practices/tests>`
* :doc:`/components/dom_crawler`
* :doc:`/components/css_selector`
* :doc:`/cookbook/testing/http_authentication`
Expand Down
6 changes: 5 additions & 1 deletion components/translation/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,11 @@ In case you want to use the same translation catalogue outside your application
(e.g. use translation on the client side), it's possible to fetch raw translation
messages. Just specify the required locale::

$messages = $translator->getMessages('fr_FR');
$catalogue = $translator->getCatalogue('fr_FR');
$messages = $catalogue->all();
while ($catalogue = $catalogue->getFallbackCatalogue()) {
$messages = array_replace_recursive($catalogue->all(), $messages);
}

The ``$messages`` variable will have the following structure::

Expand Down
2 changes: 1 addition & 1 deletion cookbook/form/form_collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ the relationship between the removed ``Tag`` and ``Task`` object.
$originalTags->add($tag);
}

$editForm = $this->createForm(new TaskType::class, $task);
$editForm = $this->createForm(TaskType::class, $task);

$editForm->handleRequest($request);

Expand Down
13 changes: 1 addition & 12 deletions cookbook/security/entity_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -430,29 +430,18 @@ interface only requires one method: ``loadUserByUsername($username)``::

use Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
use Doctrine\ORM\EntityRepository;

class UserRepository extends EntityRepository implements UserLoaderInterface
{
public function loadUserByUsername($username)
{
$user = $this->createQueryBuilder('u')
return $this->createQueryBuilder('u')
->where('u.username = :username OR u.email = :email')
->setParameter('username', $username)
->setParameter('email', $username)
->getQuery()
->getOneOrNullResult();

if (null === $user) {
$message = sprintf(
'Unable to find an active admin AppBundle:User object identified by "%s".',
$username
);
throw new UsernameNotFoundException($message);
}

return $user;
}
}

Expand Down
2 changes: 1 addition & 1 deletion cookbook/upgrade/major_version.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ Next, use Composer to download new versions of the libraries:

.. code-block:: bash
$ composer update --with-dependencies symfony/symfony
$ composer update symfony/symfony
.. include:: /cookbook/upgrade/_update_dep_errors.rst.inc

Expand Down
4 changes: 2 additions & 2 deletions create_framework/http_foundation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ version may vary).
``vendor/autoload.php`` file that allows any class to be easily
`autoloaded`_. Without autoloading, you would need to require the file
where a class is defined before being able to use it. But thanks to
`PSR-0`_, we can just let Composer and PHP do the hard work for us.
`PSR-4`_, we can just let Composer and PHP do the hard work for us.

Now, let's rewrite our application by using the ``Request`` and the
``Response`` classes::
Expand Down Expand Up @@ -309,5 +309,5 @@ applications using it (like `Symfony`_, `Drupal 8`_, `phpBB 4`_, `ezPublish
.. _`Midgard CMS`: http://www.midgard-project.org/
.. _`Zikula`: http://zikula.org/
.. _`autoloaded`: http://php.net/autoload
.. _`PSR-0`: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
.. _`PSR-4`: http://www.php-fig.org/psr/psr-4/
.. _`more`: http://symfony.com/components/HttpFoundation
2 changes: 1 addition & 1 deletion reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ start and depends on `gc_divisor`_ and `gc_probability`_.
save_path
.........

**type**: ``string`` **default**: ``%kernel.cache.dir%/sessions``
**type**: ``string`` **default**: ``%kernel.cache_dir%/sessions``

This determines the argument to be passed to the save handler. If you choose
the default file handler, this is the path where the session files are created.
Expand Down
3 changes: 3 additions & 0 deletions reference/forms/types/range.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
RangeType Field
===============

.. versionadded:: 2.8
The ``range`` type was introduced in Symfony 2.8.

The ``RangeType`` field is a slider that is rendered using the HTML5
``<input type="range" />`` tag.

Expand Down

0 comments on commit f42057a

Please sign in to comment.