Skip to content

Commit

Permalink
Merge branch '2.7' into 2.8
Browse files Browse the repository at this point in the history
* 2.7: (48 commits)
  docs: choice constraints reference
  [#7707] minor tweak
  Fixed code block under "Custom Messages"
  [#7744] fix XSD locations
  Minor XML codes fixes
  [#7686] tweak the example code
  [#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 #6427
  Update apache_router.rst
  Update fortrabbit.rst
  Fix some YAML codes
  Add missing trailing comma & Fix foreach code
  ...
  • Loading branch information
xabbuh committed Apr 8, 2017
2 parents 05c632e + 68deeb8 commit c2727e5
Show file tree
Hide file tree
Showing 82 changed files with 198 additions and 173 deletions.
11 changes: 6 additions & 5 deletions assetic/apply_to_option.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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$',
),
),
));
Expand Down
2 changes: 1 addition & 1 deletion assetic/asset_management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 4 additions & 5 deletions assetic/jpeg_optimize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ to ``true``:
<assetic:filter
name="jpegoptim"
bin="path/to/jpegoptim"
strip_all="true" />
strip-all="true" />
</assetic:config>
</container>
Expand Down Expand Up @@ -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>
Expand All @@ -234,7 +234,6 @@ following configuration:
),
'twig' => array(
'functions' => array('jpegoptim'),
),
),
));
Expand Down Expand Up @@ -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>
Expand All @@ -296,7 +295,7 @@ file:
'twig' => array(
'functions' => array(
'jpegoptim' => array(
output => 'images/*.jpg'
'output' => 'images/*.jpg',
),
),
),
Expand Down
4 changes: 2 additions & 2 deletions assetic/php.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
8 changes: 4 additions & 4 deletions assetic/uglifyjs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion best_practices/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,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
Expand Down
2 changes: 1 addition & 1 deletion bundles/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
2 changes: 1 addition & 1 deletion bundles/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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%'
Expand Down
2 changes: 1 addition & 1 deletion components/console/helpers/progressbar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,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');
Expand Down
2 changes: 1 addition & 1 deletion components/filesystem.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,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::

Expand Down
5 changes: 4 additions & 1 deletion components/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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}'));
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions components/security/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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(...);
Expand Down Expand Up @@ -229,6 +230,7 @@ own, it just needs to follow these rules:
}

// ...
}
}

Using Password Encoders
Expand Down
4 changes: 2 additions & 2 deletions components/validator/resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ method of the Validator builder::

$validator = Validation::createValidatorBuilder()
// ... add loaders
->setMetadataCache(new ApcCache('some_apc_prefix'));
->setMetadataCache(new ApcCache('some_apc_prefix'))
->getValidator();

Using a Custom MetadataFactory
Expand All @@ -193,7 +193,7 @@ this custom implementation using
use Symfony\Component\Validator\Validation;

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

.. caution::
Expand Down
15 changes: 3 additions & 12 deletions configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -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',
// ...
Expand Down
4 changes: 1 addition & 3 deletions configuration/apache_router.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ Symfony to use the ``ApacheUrlMatcher`` instead of the default one:
<!-- app/config/config_prod.xml -->
<parameters>
<parameter key="router.options.matcher.cache_class">null</parameter> <!-- disable router cache -->
<parameter key="router.options.matcher_class">
Symfony\Component\Routing\Matcher\ApacheUrlMatcher
</parameter>
<parameter key="router.options.matcher_class">Symfony\Component\Routing\Matcher\ApacheUrlMatcher</parameter>
</parameters>
.. code-block:: php
Expand Down
4 changes: 2 additions & 2 deletions configuration/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,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
Expand Down
2 changes: 1 addition & 1 deletion console/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion console/request_context.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions contributing/documentation/format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion controller/error_pages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion controller/service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ controller:
$templating = $this->templating;
$callback = function () use ($templating, $view, $parameters) {
$templating->stream($view, $parameters);
}
};
return new StreamedResponse($callback);
Expand Down
22 changes: 11 additions & 11 deletions deployment/fortrabbit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down
10 changes: 5 additions & 5 deletions doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ...
Expand Down Expand Up @@ -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%',
Expand Down
Loading

0 comments on commit c2727e5

Please sign in to comment.