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: (21 commits)
  Update optional_dependencies.rst
  Fix xml blocks
  [symfony#7875] minor tweaks
  Minor fix
  Minor changes
  [symfony#7773] fix line length
  Add helpful remarks on custom DataCollector
  Remove use of deprecated security.exception_listener.class parameter
  Update resources.rst
  Fix incoherent ut8mb4 collation in Doctrine setup
  Fix decorating service definition
  fix empty XML element
  [symfony#7873] add missing toctree entries
  Reworded the introduction of the contributing docs
  [HttpFoundation] Fix clearstatcache first arg
  Explain how to provide a stack trace
  Add link to the Slack support channel
  Mentioned FOSRestBundle's content negotiation
  Used the article example consistently in the example
  Update formats.rst
  ...
  • Loading branch information
xabbuh committed May 18, 2017
2 parents 81b8dcf + e510f67 commit 9ddaba3
Show file tree
Hide file tree
Showing 96 changed files with 1,221 additions and 599 deletions.
14 changes: 11 additions & 3 deletions bundles/best_practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,17 @@ The end user can provide values in any configuration file:
.. code-block:: xml
<!-- app/config/config.xml -->
<parameters>
<parameter key="acme_blog.author.email">[email protected]</parameter>
</parameters>
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="acme_blog.author.email">[email protected]</parameter>
</parameters>
</container>
.. code-block:: php
Expand Down
3 changes: 1 addition & 2 deletions bundles/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ thrown)::
$configuration = new Configuration();

$config = $this->processConfiguration($configuration, $configs);

// you now have these 2 config keys
// $config['twitter']['client_id'] and $config['twitter']['client_secret']
}
Expand Down Expand Up @@ -424,7 +424,6 @@ Assuming the XSD file is called ``hello-1.0.xsd``, the schema location will be
<!-- 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-hello="http://acme_company.com/schema/dic/hello"
Expand Down
20 changes: 15 additions & 5 deletions bundles/prepend_extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ users to choose to remove functionality they are not using. Creating multiple
bundles has the drawback that configuration becomes more tedious and settings
often need to be repeated for various bundles.

It is possible to remove the disadvantage of the multiple bundle approach
It is possible to remove the disadvantage of the multiple bundle approach
by enabling a single Extension to prepend the settings for any bundle.
It can use the settings defined in the ``app/config/config.yml``
to prepend settings just as if they had been written explicitly by
Expand Down Expand Up @@ -116,11 +116,21 @@ The above would be the equivalent of writing the following into the
.. code-block:: xml
<!-- app/config/config.xml -->
<acme-something:config use-acme-goodbye="false">
<acme-something:entity-manager-name>non_default</acme-something:entity-manager-name>
</acme-something:config>
<?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:acme-something="http://example.org/schema/dic/acme_something"
xmlns:acme-other="http://example.org/schema/dic/acme_other"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<acme-other:config use-acme-goodbye="false" />
<acme-something:config use-acme-goodbye="false">
<acme-something:entity-manager-name>non_default</acme-something:entity-manager-name>
</acme-something:config>
<acme-other:config use-acme-goodbye="false" />
</container>
.. code-block:: php
Expand Down
2 changes: 1 addition & 1 deletion components/http_foundation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ Please note that this will not work when the ``X-Sendfile`` header is set.

If you *just* created the file during this same request, the file *may* be sent
without any content. This may be due to cached file stats that return zero for
the size of the file. To fix this issue, call ``clearstatcache(false, $file)``
the size of the file. To fix this issue, call ``clearstatcache(true, $file)``
with the path to the binary file.

.. _component-http-foundation-json-response:
Expand Down
2 changes: 1 addition & 1 deletion components/validator/resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ In this example, the validation metadata is retrieved executing the
public static function loadValidatorMetadata(ClassMetadata $metadata)
{
$metadata->addPropertyConstraint('name', new Assert\NotBlank());
$metadata->addPropertyConstraint('name', new Asert\Length(array(
$metadata->addPropertyConstraint('name', new Assert\Length(array(
'min' => 5,
'max' => 20,
)));
Expand Down
76 changes: 60 additions & 16 deletions configuration/environments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,22 @@ accomplished easily and transparently:
.. code-block:: xml
<imports>
<import resource="config.xml" />
</imports>
<?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:doctrine="http://symfony.com/schema/dic/doctrine"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/doctrine
http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
<!-- ... -->
<imports>
<import resource="config.xml" />
</imports>
<!-- ... -->
</container>
.. code-block:: php
Expand Down Expand Up @@ -104,11 +115,22 @@ configuration file:
.. code-block:: xml
<!-- app/config/config_dev.xml -->
<imports>
<import resource="config.xml" />
</imports>
<?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:webprofiler="http://symfony.com/schema/dic/webprofiler"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/webprofiler
http://symfony.com/schema/dic/webprofiler/webprofiler-1.0.xsd">
<imports>
<import resource="config.xml" />
</imports>
<webprofiler:config toolbar="true" />
<webprofiler:config toolbar="true" />
</container>
.. code-block:: php
Expand Down Expand Up @@ -201,7 +223,18 @@ this code and changing the environment string.
.. code-block:: xml
<doctrine:dbal logging="%kernel.debug%" />
<?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:doctrine="http://symfony.com/schema/dic/doctrine"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/doctrine
http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
<doctrine:dbal logging="%kernel.debug%" />
</container>
.. code-block:: php
Expand Down Expand Up @@ -283,13 +316,24 @@ The best way to accomplish this is via a new environment called, for example,
.. code-block:: xml
<!-- app/config/config_benchmark.xml -->
<imports>
<import resource="config_prod.xml" />
</imports>
<framework:config>
<framework:profiler only-exceptions="false" />
</framework:config>
<?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"
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">
<imports>
<import resource="config_prod.xml" />
</imports>
<framework:config>
<framework:profiler only-exceptions="false" />
</framework:config>
</container>
.. code-block:: php
Expand Down
45 changes: 31 additions & 14 deletions configuration/external_parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,26 @@ You can now reference these parameters wherever you need them.
.. code-block:: xml
<!-- xmlns:doctrine="http://symfony.com/schema/dic/doctrine" -->
<!-- xsi:schemaLocation="http://symfony.com/schema/dic/doctrine http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd"> -->
<doctrine:config>
<doctrine:dbal
driver="pdo_mysql"
dbname="symfony_project"
user="%database.user%"
password="%database.password%"
/>
</doctrine:config>
<!-- app/config/config.xml -->
<?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:doctrine="http://symfony.com/schema/dic/doctrine"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/doctrine
http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
<doctrine:config>
<doctrine:dbal
driver="pdo_mysql"
dbname="symfony_project"
user="%database.user%"
password="%database.password%"
/>
</doctrine:config>
</container>
.. code-block:: php
Expand Down Expand Up @@ -150,9 +159,17 @@ in the container. The following imports a file named ``parameters.php``.
.. code-block:: xml
<!-- app/config/config.xml -->
<imports>
<import resource="parameters.php" />
</imports>
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<imports>
<import resource="parameters.php" />
</imports>
</container>
.. code-block:: php
Expand Down
2 changes: 2 additions & 0 deletions configuration/override_dir_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ define your own templates directory (or directories):
<twig:config>
<twig:path>%kernel.root_dir%/../templates</twig:path>
</twig:config>
</container>
.. code-block:: php
Expand Down Expand Up @@ -192,6 +193,7 @@ file:
<!-- ... -->
<assetic:config read-from="%kernel.root_dir%/../../public_html" />
</container>
.. code-block:: php
Expand Down
8 changes: 4 additions & 4 deletions configuration/using_parameters_in_dic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ Now, examine the results to see this closely:
<my-bundle:config logging="true" />
<!-- true, as expected -->
<my-bundle:config logging="%kernel.debug%" />
<!-- true/false (depends on 2nd parameter of AppKernel),
as expected, because %kernel.debug% inside configuration
gets evaluated before being passed to the extension -->
<my-bundle:config logging="%kernel.debug%" />
<!-- true/false (depends on 2nd parameter of AppKernel),
as expected, because %kernel.debug% inside configuration
gets evaluated before being passed to the extension -->
<my-bundle:config />
<!-- passes the string "%kernel.debug%".
Expand Down
8 changes: 5 additions & 3 deletions console/commands_as_services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ with ``console.command``:
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="app.command.my_command"
class="AppBundle\Command\MyCommand">
<tag name="console.command" />
</service>
</services>
</container>
.. code-block:: php
Expand Down Expand Up @@ -89,7 +90,7 @@ store the default value in some ``%command.default_name%`` parameter::
public function __construct($defaultName)
{
$this->defaultName = $defaultName;

parent::__construct();
}

Expand Down Expand Up @@ -145,7 +146,7 @@ inject the ``command.default_name`` parameter:
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="command.default_name">Javier</parameter>
Expand All @@ -158,6 +159,7 @@ inject the ``command.default_name`` parameter:
<tag name="console.command" />
</service>
</services>
</container>
.. code-block:: php
Expand Down
12 changes: 8 additions & 4 deletions console/logging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,17 @@ First configure a listener for console exception events in the service container
<!-- app/config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="app.listener.command_exception" class="AppBundle\EventListener\ConsoleExceptionListener">
<argument type="service" id="logger"/>
<tag name="kernel.event_listener" event="console.exception" />
</service>
</services>
</container>
.. code-block:: php
Expand Down Expand Up @@ -189,15 +191,17 @@ First configure a listener for console terminate events in the service container
<!-- app/config/services.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="app.listener.command_error" class="AppBundle\EventListener\ErrorLoggerListener">
<argument type="service" id="logger"/>
<tag name="kernel.event_listener" event="console.terminate" />
</service>
</services>
</container>
.. code-block:: php
Expand Down
2 changes: 1 addition & 1 deletion console/request_context.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ will override the defaults.
<!-- app/config/parameters.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Expand All @@ -50,6 +49,7 @@ will override the defaults.
<parameter key="router.request_context.scheme">https</parameter>
<parameter key="router.request_context.base_url">my/path</parameter>
</parameters>
</container>
.. code-block:: php
Expand Down
Loading

0 comments on commit 9ddaba3

Please sign in to comment.