Skip to content

Commit

Permalink
Merge branch '2.8' into 3.2
Browse files Browse the repository at this point in the history
* 2.8: (48 commits)
  docs: choice constraints reference
  [symfony#7707] minor tweak
  Fixed code block under "Custom Messages"
  [symfony#7744] fix XSD locations
  Minor XML codes fixes
  [symfony#7686] tweak the example code
  [symfony#7663] update the PHP example code
  Update hostname_pattern.rst
  Add missing ";"
  Use HTTP instead of http
  Fixed indentation in security.rst
  Be consistent on service name
  Fix missing /
  Fix trusted hosts example regular expressions
  fixup comment
  Testing: Fix typo from symfony#6427
  Update apache_router.rst
  Update fortrabbit.rst
  Fix some YAML codes
  Add missing trailing comma & Fix foreach code
  ...
xabbuh committed Apr 13, 2017
2 parents e46c911 + c2727e5 commit fa3120e
Showing 81 changed files with 195 additions and 165 deletions.
11 changes: 6 additions & 5 deletions assetic/apply_to_option.rst
Original file line number Diff line number Diff line change
@@ -163,8 +163,9 @@ In this case you can specify that the ``coffee`` filter is applied to all
name="coffee"
bin="/usr/bin/coffee"
node="/usr/bin/node"
apply_to="\.coffee$" />
<assetic:node-paths>/usr/lib/node_modules/</assetic:node-path>
apply-to="\.coffee$">
<assetic:node-path>/usr/lib/node_modules/</assetic:node-path>
</assetic:filter>
</assetic:config>
</container>
@@ -174,10 +175,10 @@ In this case you can specify that the ``coffee`` filter is applied to all
$container->loadFromExtension('assetic', array(
'filters' => array(
'coffee' => array(
'bin' => '/usr/bin/coffee',
'node' => '/usr/bin/node',
'bin' => '/usr/bin/coffee',
'node' => '/usr/bin/node',
'node_paths' => array('/usr/lib/node_modules/'),
'apply_to' => '\.coffee$',
'apply_to' => '\.coffee$',
),
),
));
2 changes: 1 addition & 1 deletion assetic/asset_management.rst
Original file line number Diff line number Diff line change
@@ -411,7 +411,7 @@ configuration under the ``assetic`` section. Read more in the
),
),
),
);
));
After you have defined the named assets, you can reference them in your templates
with the ``@named_asset`` notation:
9 changes: 4 additions & 5 deletions assetic/jpeg_optimize.rst
Original file line number Diff line number Diff line change
@@ -113,7 +113,7 @@ to ``true``:
<assetic:filter
name="jpegoptim"
bin="path/to/jpegoptim"
strip_all="true" />
strip-all="true" />
</assetic:config>
</container>
@@ -217,7 +217,7 @@ following configuration:
name="jpegoptim"
bin="path/to/jpegoptim" />
<assetic:twig>
<assetic:twig_function
<assetic:function
name="jpegoptim" />
</assetic:twig>
</assetic:config>
@@ -234,7 +234,6 @@ following configuration:
),
'twig' => array(
'functions' => array('jpegoptim'),
),
),
));
@@ -277,7 +276,7 @@ file:
name="jpegoptim"
bin="path/to/jpegoptim" />
<assetic:twig>
<assetic:twig_function
<assetic:function
name="jpegoptim"
output="images/*.jpg" />
</assetic:twig>
@@ -296,7 +295,7 @@ file:
'twig' => array(
'functions' => array(
'jpegoptim' => array(
output => 'images/*.jpg'
'output' => 'images/*.jpg',
),
),
),
4 changes: 2 additions & 2 deletions assetic/php.rst
Original file line number Diff line number Diff line change
@@ -99,7 +99,7 @@ First, configure a new ``scssphp`` Assetic filter:
http://symfony.com/schema/dic/assetic/assetic-1.0.xsd">
<assetic:config>
<filter name="scssphp" formatter="Leafo\ScssPhp\Formatter\Compressed" />
<assetic:filter name="scssphp" formatter="Leafo\ScssPhp\Formatter\Compressed" />
<!-- ... -->
</assetic:config>
</container>
@@ -172,7 +172,7 @@ First, configure a new ``jsqueeze`` Assetic filter as follows:
http://symfony.com/schema/dic/assetic/assetic-1.0.xsd">
<assetic:config>
<filter name="jsqueeze" />
<assetic:filter name="jsqueeze" />
<!-- ... -->
</assetic:config>
</container>
8 changes: 4 additions & 4 deletions assetic/uglifyjs.rst
Original file line number Diff line number Diff line change
@@ -170,11 +170,11 @@ can configure its location using the ``node`` key:
// app/config/config.php
$container->loadFromExtension('assetic', array(
'node' => '/usr/bin/nodejs',
'node' => '/usr/bin/nodejs',
'uglifyjs2' => array(
// the path to the uglifyjs executable
'bin' => '/usr/local/bin/uglifyjs',
),
// the path to the uglifyjs executable
'bin' => '/usr/local/bin/uglifyjs',
),
));
Minify your Assets
2 changes: 1 addition & 1 deletion best_practices/security.rst
Original file line number Diff line number Diff line change
@@ -335,7 +335,7 @@ To enable the security voter in the application, define a new service:
# app/config/services.yml
services:
# ...
post_voter:
app.post_voter:
class: AppBundle\Security\PostVoter
arguments: ['@security.access.decision_manager']
public: false
2 changes: 1 addition & 1 deletion bundles/configuration.rst
Original file line number Diff line number Diff line change
@@ -81,8 +81,8 @@ bundle configuration would look like:
<!-- app/config/config.xml -->
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:acme-social="http://example.org/schema/dic/acme_social"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
2 changes: 1 addition & 1 deletion bundles/installation.rst
Original file line number Diff line number Diff line change
@@ -118,7 +118,7 @@ of the bundle's configuration:
The output will look like this:

.. code-block:: text
.. code-block:: yaml
assetic:
debug: '%kernel.debug%'
2 changes: 1 addition & 1 deletion components/console/helpers/progressbar.rst
Original file line number Diff line number Diff line change
@@ -300,7 +300,7 @@ before displaying these messages, you must define your own custom format::
$progressBar->setFormat('custom');

Now, use the ``setMessage()`` method to set the value of the ``%message%``
placeholder before displaying the progress bar:
placeholder before displaying the progress bar::

// ...
$progressBar->setMessage('Start');
2 changes: 1 addition & 1 deletion components/filesystem.rst
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ endpoint for filesystem operations::
mkdir
~~~~~

:method:`Symfony\\Component\\Filesystem\\Filesystem::mkdir` creates a directory.
:method:`Symfony\\Component\\Filesystem\\Filesystem::mkdir` creates a directory recursively.
On POSIX filesystems, directories are created with a default mode value
`0777`. You can use the second argument to set your own mode::

5 changes: 4 additions & 1 deletion components/routing.rst
Original file line number Diff line number Diff line change
@@ -206,6 +206,9 @@ to find a route that fits the given request you can also build a URL from
a certain route::

use Symfony\Component\Routing\Generator\UrlGenerator;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;

$routes = new RouteCollection();
$routes->add('show_post', new Route('/show/{slug}'));
@@ -321,7 +324,7 @@ a path to the main route definition and some other settings::
$resource,
array $options = array(),
RequestContext $context = null,
array $defaults = array()
LoggerInterface $logger = null
);

With the ``cache_dir`` option you can enable route caching (if you provide a
2 changes: 2 additions & 0 deletions components/security/authentication.rst
Original file line number Diff line number Diff line change
@@ -71,6 +71,7 @@ The default authentication manager is an instance of
:class:`Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager`::

use Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager;
use Symfony\Component\Security\Core\Exception\AuthenticationException;

// instances of Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface
$providers = array(...);
@@ -229,6 +230,7 @@ own, it just needs to follow these rules:
}

// ...
}
}

Using Password Encoders
2 changes: 1 addition & 1 deletion components/validator/resources.rst
Original file line number Diff line number Diff line change
@@ -187,7 +187,7 @@ this custom implementation using
use Symfony\Component\Validator\Validation;

$validator = Validation::createValidatorBuilder()
->setMetadataFactory(new CustomMetadataFactory(...));
->setMetadataFactory(new CustomMetadataFactory(...))
->getValidator();

.. caution::
15 changes: 3 additions & 12 deletions configuration.rst
Original file line number Diff line number Diff line change
@@ -150,14 +150,8 @@ it *also* loads other configuration files via its ``imports`` key:
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xmlns:twig="http://symfony.com/schema/dic/twig"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd
http://symfony.com/schema/dic/twig
http://symfony.com/schema/dic/twig/twig-1.0.xsd">
http://symfony.com/schema/dic/services/services-1.0.xsd">
<imports>
<import resource="parameters.yml" />
@@ -216,13 +210,10 @@ key:
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xmlns:twig="http://symfony.com/schema/dic/twig"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd
http://symfony.com/schema/dic/twig
http://symfony.com/schema/dic/twig/twig-1.0.xsd">
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
<!-- ... -->
<parameters>
@@ -316,7 +307,7 @@ configure DoctrineBundle and other parts of Symfony:
.. code-block:: php
// app/config/config.php
$configuration->loadFromExtension('doctrine', array(
$container->loadFromExtension('doctrine', array(
'dbal' => array(
'driver' => 'pdo_mysql',
// ...
4 changes: 2 additions & 2 deletions configuration/environments.rst
Original file line number Diff line number Diff line change
@@ -290,10 +290,10 @@ The best way to accomplish this is via a new environment called, for example,
.. code-block:: php
// app/config/config_benchmark.php
$loader->import('config_prod.php')
$loader->import('config_prod.php');
$container->loadFromExtension('framework', array(
'profiler' => array('only-exceptions' => false),
'profiler' => array('only_exceptions' => false),
));
.. include:: /components/dependency_injection/_imports-parameters-note.rst.inc
2 changes: 1 addition & 1 deletion console/input.rst
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ To use this, just specify as many names as you want:
You can access the ``names`` argument as an array::

$names = $input->getArgument('names')
$names = $input->getArgument('names');
if (count($names) > 0) {
$text .= ' '.implode(', ', $names);
}
2 changes: 1 addition & 1 deletion console/request_context.rst
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ will override the defaults.
.. code-block:: php
// app/config/config_test.php
// app/config/parameters.php
$container->setParameter('router.request_context.host', 'example.org');
$container->setParameter('router.request_context.scheme', 'https');
$container->setParameter('router.request_context.base_url', 'my/path');
4 changes: 2 additions & 2 deletions contributing/documentation/format.rst
Original file line number Diff line number Diff line change
@@ -195,8 +195,8 @@ Whenever a new minor version of Symfony is released (e.g. 2.4, 2.5, etc),
a new branch of the documentation is created from the ``master`` branch.
At this point, all the ``versionadded`` tags for Symfony versions that have
reached end-of-maintenance will be removed. For example, if Symfony 2.5 were
released today, and 2.2 had recently reached its end-of-life, the 2.2 ``versionadded``
tags would be removed from the new ``2.5`` branch.
released today, and 2.2 had recently reached its end-of-maintenance, the 2.2
``versionadded`` tags would be removed from the new ``2.5`` branch.

.. _reStructuredText: http://docutils.sourceforge.net/rst.html
.. _Sphinx: http://sphinx-doc.org/
2 changes: 1 addition & 1 deletion controller/error_pages.rst
Original file line number Diff line number Diff line change
@@ -211,7 +211,7 @@ configuration option to point to it:
# app/config/config.yml
twig:
exception_controller: AppBundle:Exception:showException
exception_controller: AppBundle:Exception:showException
.. code-block:: xml
2 changes: 1 addition & 1 deletion controller/service.rst
Original file line number Diff line number Diff line change
@@ -332,7 +332,7 @@ controller:
$templating = $this->templating;
$callback = function () use ($templating, $view, $parameters) {
$templating->stream($view, $parameters);
}
};
return new StreamedResponse($callback);
22 changes: 11 additions & 11 deletions deployment/fortrabbit.rst
Original file line number Diff line number Diff line change
@@ -122,16 +122,16 @@ Make sure this file is imported into the main config file:
.. code-block:: yaml
# app/config/config_prod.yml
imports:
- { resource: config.yml }
- { resource: config_prod_secrets.php }
imports:
- { resource: config.yml }
- { resource: config_prod_secrets.php }
# ..
framework:
session:
# set handler_id to null to use default session handler from php.ini (memcached)
handler_id: ~
# ..
# ..
framework:
session:
# set handler_id to null to use default session handler from php.ini (memcached)
handler_id: ~
# ..
.. code-block:: xml
@@ -151,14 +151,14 @@ Make sure this file is imported into the main config file:
<!-- .. -->
<framework:config>
<!-- .. -->
<framework:session save_path="null" />
<framework:session save-path="null" />
</framework:config>
</container>
.. code-block:: php
// app/config/config_prod.php
$loader->import('config/config.php');
$loader->import('config.php');
$loader->import('config_prod_secrets.php');
$container->loadFromExtension('framework', array(
10 changes: 5 additions & 5 deletions doctrine.rst
Original file line number Diff line number Diff line change
@@ -44,10 +44,10 @@ information. By convention, this information is usually configured in an
# app/config/parameters.yml
parameters:
database_host: localhost
database_name: test_project
database_user: root
database_password: password
database_host: localhost
database_name: test_project
database_user: root
database_password: password
# ...
@@ -95,7 +95,7 @@ information. By convention, this information is usually configured in an
.. code-block:: php
// app/config/config.php
$configuration->loadFromExtension('doctrine', array(
$container->loadFromExtension('doctrine', array(
'dbal' => array(
'driver' => 'pdo_mysql',
'host' => '%database_host%',
4 changes: 2 additions & 2 deletions doctrine/pdo_session_storage.rst
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ To use it, you just need to change some parameters in the main configuration fil
<services>
<service id="session.handler.pdo" class="Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler" public="false">
<argument>mysql:dbname=mydatabase</agruement>
<argument>mysql:dbname=mydatabase</argument>
<argument type="collection">
<argument key="db_username">myuser</argument>
<argument key="db_password">mypassword</argument>
@@ -93,7 +93,7 @@ a second array argument to ``PdoSessionHandler``:
<!-- app/config/config.xml -->
<services>
<service id="session.handler.pdo" class="Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler" public="false">
<argument>mysql:dbname=mydatabase</agruement>
<argument>mysql:dbname=mydatabase</argument>
<argument type="collection">
<argument key="db_table">sessions</argument>
<argument key="db_username">myuser</argument>
2 changes: 1 addition & 1 deletion form/action_method.rst
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ to the ``form()`` or the ``form_start()`` helper functions:

.. code-block:: html+php

<!-- app/Resources/views/default/newAction.html.php -->
<!-- app/Resources/views/default/new.html.php -->
<?php echo $view['form']->start($form, array(
// The path() method was introduced in Symfony 2.8. Prior to 2.8,
// you had to use generate().
Loading
Oops, something went wrong.

0 comments on commit fa3120e

Please sign in to comment.