Skip to content

Commit ae8474d

Browse files
committed
Merge branch '2.3' into 2.6
Conflicts: components/options_resolver.rst
2 parents 28956ce + 94aed12 commit ae8474d

28 files changed

+241
-12
lines changed

components/class_loader/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,7 @@ You can install the component in 2 different ways:
4141
on `Packagist`_);
4242
* Use the official Git repository (https://github.com/symfony/ClassLoader).
4343

44+
.. include:: /components/require_autoload.rst.inc
45+
4446
.. _`autoloading mechanism`: http://php.net/manual/en/language.oop5.autoload.php
4547
.. _Packagist: https://packagist.org/packages/symfony/class-loader

components/config/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ You can install the component in 2 different ways:
1717
* :doc:`Install it via Composer </components/using_components>` (``symfony/config`` on `Packagist`_);
1818
* Use the official Git repository (https://github.com/symfony/Config).
1919

20+
.. include:: /components/require_autoload.rst.inc
21+
2022
Sections
2123
--------
2224

components/console/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ You can install the component in 2 different ways:
2020
* :doc:`Install it via Composer </components/using_components>` (``symfony/console`` on `Packagist`_);
2121
* Use the official Git repository (https://github.com/symfony/Console).
2222

23+
.. include:: /components/require_autoload.rst.inc
24+
2325
Creating a basic Command
2426
------------------------
2527

components/css_selector.rst

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ You can install the component in 2 different ways:
1515
* :doc:`Install it via Composer </components/using_components>` (``symfony/css-selector`` on `Packagist`_);
1616
* Use the official Git repository (https://github.com/symfony/CssSelector).
1717

18+
.. include:: /components/require_autoload.rst.inc
19+
1820
Usage
1921
-----
2022

components/debug/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ You can install the component in many different ways:
1919
* :doc:`Install it via Composer </components/using_components>` (``symfony/debug`` on `Packagist`_);
2020
* Use the official Git repository (https://github.com/symfony/Debug).
2121

22+
.. include:: /components/require_autoload.rst.inc
23+
2224
Usage
2325
-----
2426

components/dependency_injection/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ You can install the component in 2 different ways:
1919
* :doc:`Install it via Composer </components/using_components>` (``symfony/dependency-injection`` on `Packagist`_);
2020
* Use the official Git repository (https://github.com/symfony/DependencyInjection).
2121

22+
.. include:: /components/require_autoload.rst.inc
23+
2224
Basic Usage
2325
-----------
2426

components/dom_crawler.rst

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ You can install the component in 2 different ways:
2020
* :doc:`Install it via Composer </components/using_components>` (``symfony/dom-crawler`` on `Packagist`_);
2121
* Use the official Git repository (https://github.com/symfony/DomCrawler).
2222

23+
.. include:: /components/require_autoload.rst.inc
24+
2325
Usage
2426
-----
2527

components/event_dispatcher/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ You can install the component in 2 different ways:
5656
* :doc:`Install it via Composer </components/using_components>` (``symfony/event-dispatcher`` on `Packagist`_);
5757
* Use the official Git repository (https://github.com/symfony/EventDispatcher).
5858

59+
.. include:: /components/require_autoload.rst.inc
60+
5961
Usage
6062
-----
6163

components/filesystem/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ You can install the component in 2 different ways:
1919
* :doc:`Install it via Composer </components/using_components>` (``symfony/filesystem`` on `Packagist`_);
2020
* Use the official Git repository (https://github.com/symfony/Filesystem).
2121

22+
.. include:: /components/require_autoload.rst.inc
23+
2224
Usage
2325
-----
2426

components/finder.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ You can install the component in 2 different ways:
1616
* :doc:`Install it via Composer </components/using_components>` (``symfony/finder`` on `Packagist`_);
1717
* Use the official Git repository (https://github.com/symfony/Finder).
1818

19+
.. include:: /components/require_autoload.rst.inc
20+
1921
Usage
2022
-----
2123

@@ -302,7 +304,7 @@ The contents of returned files can be read with
302304

303305
foreach ($finder as $file) {
304306
$contents = $file->getContents();
305-
307+
306308
// ...
307309
}
308310

components/form/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ You can install the component in 2 different ways:
2222
* :doc:`Install it via Composer </components/using_components>` (``symfony/form`` on `Packagist`_);
2323
* Use the official Git repository (https://github.com/symfony/Form).
2424

25+
.. include:: /components/require_autoload.rst.inc
26+
2527
Configuration
2628
-------------
2729

components/http_foundation/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ You can install the component in 2 different ways:
2424
* :doc:`Install it via Composer </components/using_components>` (``symfony/http-foundation`` on `Packagist`_);
2525
* Use the official Git repository (https://github.com/symfony/HttpFoundation).
2626

27+
.. include:: /components/require_autoload.rst.inc
28+
2729
.. _component-http-foundation-request:
2830

2931
Request

components/http_kernel/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ You can install the component in 2 different ways:
1919
* :doc:`Install it via Composer </components/using_components>` (``symfony/http-kernel`` on Packagist_);
2020
* Use the official Git repository (https://github.com/symfony/HttpKernel).
2121

22+
.. include:: /components/require_autoload.rst.inc
23+
2224
The Workflow of a Request
2325
-------------------------
2426

components/options_resolver.rst

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ You can install the component in 2 different ways:
1717
* :doc:`Install it via Composer </components/using_components>` (``symfony/options-resolver`` on `Packagist`_);
1818
* Use the official Git repository (https://github.com/symfony/OptionsResolver).
1919

20+
.. include:: /components/require_autoload.rst.inc
21+
2022
Notes on Previous Versions
2123
--------------------------
2224

components/process.rst

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ You can install the component in 2 different ways:
1515
* :doc:`Install it via Composer </components/using_components>` (``symfony/process`` on `Packagist`_);
1616
* Use the official Git repository (https://github.com/symfony/Process).
1717

18+
.. include:: /components/require_autoload.rst.inc
19+
1820
Usage
1921
-----
2022

components/property_access/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ You can install the component in two different ways:
1616
* :doc:`Install it via Composer</components/using_components>` (``symfony/property-access`` on `Packagist`_);
1717
* Use the official Git repository (https://github.com/symfony/PropertyAccess).
1818

19+
.. include:: /components/require_autoload.rst.inc
20+
1921
Usage
2022
-----
2123

components/require_autoload.rst.inc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Then, require the ``vendor/autoload.php`` file to enable the autoloading mechanism
2+
provided by Composer. Otherwise, your application won't be able to find the classes
3+
of this Symfony component.

components/routing/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ You can install the component in 2 different ways:
1616
* :doc:`Install it via Composer </components/using_components>` (``symfony/routing`` on `Packagist`_);
1717
* Use the official Git repository (https://github.com/symfony/Routing).
1818

19+
.. include:: /components/require_autoload.rst.inc
20+
1921
Usage
2022
-----
2123

components/security/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ You can install the component in 2 different ways:
1919
* :doc:`Install it via Composer </components/using_components>` (``symfony/security`` on Packagist_);
2020
* Use the official Git repository (https://github.com/symfony/Security).
2121

22+
.. include:: /components/require_autoload.rst.inc
23+
2224
Sections
2325
--------
2426

components/serializer.rst

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ You can install the component in 2 different ways:
3333
* :doc:`Install it via Composer </components/using_components>` (``symfony/serializer`` on `Packagist`_);
3434
* Use the official Git repository (https://github.com/symfony/Serializer).
3535

36+
.. include:: /components/require_autoload.rst.inc
37+
3638
Usage
3739
-----
3840

components/stopwatch.rst

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ You can install the component in two different ways:
1515
* :doc:`Install it via Composer</components/using_components>` (``symfony/stopwatch`` on `Packagist`_);
1616
* Use the official Git repository (https://github.com/symfony/Stopwatch).
1717

18+
.. include:: /components/require_autoload.rst.inc
19+
1820
Usage
1921
-----
2022

components/templating/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ You can install the component in 2 different ways:
2121
* :doc:`Install it via Composer </components/using_components>` (``symfony/templating`` on `Packagist`_);
2222
* Use the official Git repository (https://github.com/symfony/Templating).
2323

24+
.. include:: /components/require_autoload.rst.inc
25+
2426
Usage
2527
-----
2628

components/translation/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ You can install the component in 2 different ways:
1616
* :doc:`Install it via Composer </components/using_components>` (``symfony/translation`` on `Packagist`_);
1717
* Use the official Git repository (https://github.com/symfony/Translation).
1818

19+
.. include:: /components/require_autoload.rst.inc
20+
1921
Constructing the Translator
2022
---------------------------
2123

components/yaml/introduction.rst

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ You can install the component in 2 different ways:
3434
* :doc:`Install it via Composer </components/using_components>` (``symfony/yaml`` on `Packagist`_);
3535
* Use the official Git repository (https://github.com/symfony/Yaml).
3636

37+
.. include:: /components/require_autoload.rst.inc
38+
3739
Why?
3840
----
3941

cookbook/console/command_in_controller.rst

+12-11
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Run this command from inside your controller via::
3030
use Symfony\Bundle\FrameworkBundle\Console\Application;
3131
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
3232
use Symfony\Component\Console\Input\ArrayInput;
33-
use Symfony\Component\Console\Output\BufferedOutput;
33+
use Symfony\Component\Console\Output\StreamOutput;
3434
use Symfony\Component\HttpFoundation\Response;
3535

3636
class SpoolController extends Controller
@@ -46,12 +46,14 @@ Run this command from inside your controller via::
4646
'--message-limit' => $messages,
4747
));
4848
// You can use NullOutput() if you don't need the output
49-
$output = new BufferedOutput();
49+
$output = new StreamOutput(tmpfile(), StreamOutput::VERBOSITY_NORMAL);
5050
$application->run($input, $output);
5151

5252
// return the output, don't use if you used NullOutput()
53-
$content = $output->fetch();
54-
53+
rewind($output->getStream());
54+
$content = stream_get_contents($output->getStream());
55+
fclose($output->getStream());
56+
5557
// return new Response(""), if you used NullOutput()
5658
return new Response($content);
5759
}
@@ -60,7 +62,7 @@ Run this command from inside your controller via::
6062
Showing Colorized Command Output
6163
--------------------------------
6264

63-
By telling the ``BufferedOutput`` it is decorated via the second parameter,
65+
By telling the ``StreamOutput`` it is decorated via the third parameter,
6466
it will return the Ansi color-coded content. The `SensioLabs AnsiToHtml converter`_
6567
can be used to convert this to colorful HTML.
6668

@@ -76,8 +78,8 @@ Now, use it in your controller::
7678
namespace AppBundle\Controller;
7779

7880
use SensioLabs\AnsiConverter\AnsiToHtmlConverter;
79-
use Symfony\Component\Console\Output\BufferedOutput;
8081
use Symfony\Component\Console\Output\OutputInterface;
82+
use Symfony\Component\Console\Output\StreamOutput;
8183
use Symfony\Component\HttpFoundation\Response;
8284
// ...
8385

@@ -86,15 +88,14 @@ Now, use it in your controller::
8688
public function sendSpoolAction($messages = 10)
8789
{
8890
// ...
89-
$output = new BufferedOutput(
90-
OutputInterface::VERBOSITY_NORMAL,
91-
true // true for decorated
92-
);
91+
$output = new StreamOutput(tmpfile(), StreamOutput::VERBOSITY_NORMAL, true);
9392
// ...
9493

9594
// return the output
9695
$converter = new AnsiToHtmlConverter();
97-
$content = $output->fetch();
96+
rewind($output->getStream());
97+
$content = stream_get_contents($output->getStream());
98+
fclose($output->getStream());
9899

99100
return new Response($converter->convert($content));
100101
}

cookbook/controller/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ Controller
66

77
error_pages
88
service
9+
upload_file

0 commit comments

Comments
 (0)