Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf191cc4

Browse files
committed
Merge branch '2.0' into 2.1
Conflicts:book/installation.rst
2 parentsd7e8a07 +a54b298 commitf191cc4

File tree

5 files changed

+85
-4
lines changed

5 files changed

+85
-4
lines changed

‎book/installation.rst‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ you should have a directory that looks something like this:
7575

7676
..code-block::text
7777
78-
path/to/webroot/ <- your webroot directory
78+
path/to/webroot/ <- your webserver directory (sometimes named htdocs or public)
7979
Symfony/ <- the new directory
8080
app/
8181
cache/
@@ -123,6 +123,22 @@ next section.
123123
:doc:`/cookbook/configuration/override_dir_structure` for more
124124
information.
125125

126+
All public files and the front controller that handles incoming requests in
127+
a Symfony2 application live in the ``Symfony/web/`` directory. So, assuming
128+
you unpacked the archive into your web server's or virtual host's document root,
129+
your application's URLs will start with ``http://localhost/Symfony/web/``.
130+
To get nice and short URLs you should point the document root of your web
131+
server or virtual host to the ``Symfony/web/`` directory. Though this is not
132+
required for development it is recommended when your application goes into
133+
production as all system and configuration files become inaccessible to clients.
134+
For information on configuring your specific web server document root, see
135+
the following documentation: `Apache`_ | `Nginx`_ .
136+
137+
..note::
138+
139+
The following examples assume you don't touch the document root settings
140+
so all URLs start with ``http://localhost/Symfony/web/``
141+
126142
.. _installation-updating-vendors:
127143

128144
Updating Vendors

‎book/internals.rst‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ variables:
4444
:class:`Symfony\\Component\\HttpFoundation\\SessionStorage\\SessionStorageInterface`
4545
interface abstract session management ``session_*()`` functions.
4646

47+
..note::
48+
49+
Read more about the:doc:`HttpFoundation Component</components/http_foudation/introduction>`.
50+
4751
``HttpKernel`` Component
4852
~~~~~~~~~~~~~~~~~~~~~~~~
4953

@@ -58,7 +62,8 @@ Dependency Injection component and a powerful plugin system (bundles).
5862

5963
..seealso::
6064

61-
Read more about:doc:`Dependency Injection</book/service_container>` and
65+
Read more about the:doc:`HttpKernel Component</components/http_kernel/introduction>`,
66+
:doc:`Dependency Injection</book/service_container>` and
6267
:doc:`Bundles</cookbook/bundles/best_practices>`.
6368

6469
``FrameworkBundle`` Bundle
@@ -256,6 +261,10 @@ uses a :class:`Symfony\\Component\\Routing\\RouterInterface` object to match
256261
the ``Request`` and determine the Controller name (stored in the
257262
``_controller`` ``Request`` attribute).
258263

264+
..seealso::
265+
266+
Read more on the:ref:`kernel.request event<component-http-kernel-kernel-request>`.
267+
259268
..index::
260269
single: Event; kernel.controller
261270

@@ -278,6 +287,10 @@ to modify the controller that should be executed::
278287
$event->setController($controller);
279288
}
280289

290+
..seealso::
291+
292+
Read more on the:ref:`kernel.controller event<component-http-kernel-kernel-controller>`.
293+
281294
..index::
282295
single: Event; kernel.view
283296

@@ -307,6 +320,10 @@ The value returned by the Controller is accessible via the
307320
$event->setResponse($response);
308321
}
309322

323+
..seealso::
324+
325+
Read more on the:ref:`kernel.view event<component-http-kernel-kernel-view>`.
326+
310327
..index::
311328
single: Event; kernel.response
312329

@@ -340,6 +357,10 @@ The ``FrameworkBundle`` registers several listeners:
340357
``Surrogate-Control`` HTTP header when the Response needs to be parsed for
341358
ESI tags.
342359

360+
..seealso::
361+
362+
Read more on the:ref:`kernel.response event<component-http-kernel-kernel-response>`.
363+
343364
..index::
344365
single: Event; kernel.exception
345366

@@ -393,6 +414,10 @@ The event dispatcher is a standalone component that is responsible for much
393414
of the underlying logic and flow behind a Symfony request. For more information,
394415
see the:doc:`Event Dispatcher Component Documentation</components/event_dispatcher/introduction>`.
395416

417+
..seealso::
418+
419+
Read more on the:ref:`kernel.exception event<component-http-kernel-kernel-exception>`.
420+
396421
..index::
397422
single: Profiler
398423

‎components/console/helpers/dialoghelper.rst‎

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,43 @@ You can set the max number of times to ask in the ``$attempts`` argument.
9797
If you reach this max number it will use the default value, which is given
9898
in the last argument. Using ``false`` means the amount of attempts is infinite.
9999
The user will be asked as long as he provides an invalid answer and will only
100-
be able to proceed if her input is valid.
100+
be able to proceed if her input is valid.
101+
102+
Testing a Command which expects input
103+
-------------------------------------
104+
105+
If you want to write a unit test for a command which expects some kind of input
106+
from the command line, you need to overwrite the HelperSet used by the command::
107+
108+
use Symfony\Component\Console\Helper\DialogHelper;
109+
use Symfony\Component\Console\Helper\HelperSet;
110+
111+
// ...
112+
public function testExecute()
113+
{
114+
// ...
115+
$commandTester = new CommandTester($command);
116+
117+
$dialog = $command->getHelper('dialog');
118+
$dialog->setInputStream($this->getInputStream('Test\n'));
119+
// Equals to a user inputing "Test" and hitting ENTER
120+
// If you need to enter a confirmation, "yes\n" will work
121+
122+
$commandTester->execute(array('command' => $command->getName()));
123+
124+
// $this->assertRegExp('/.../', $commandTester->getDisplay());
125+
}
126+
127+
protected function getInputStream($input)
128+
{
129+
$stream = fopen('php://memory', 'r+', false);
130+
fputs($stream, $input);
131+
rewind($stream);
132+
133+
return $stream;
134+
}
135+
136+
By setting the inputStream of the ``DialogHelper``, you imitate what the
137+
console would do internally with all user input through the cli. This way
138+
you can test any user interaction (even complex ones) by passing an appropriate
139+
input stream.

‎components/http_kernel/introduction.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ will be called after another event - ``kernel.controller`` - is dispatched.
259259
There are also a few other variations on the above process (e.g. if
260260
you're registering your controllers as services).
261261

262+
.. _component-http-kernel-kernel-controller:
263+
262264
3) The ``kernel.controller`` event
263265
----------------------------------
264266

‎reference/forms/types/repeated.rst‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ accuracy.
2424
+-------------+------------------------------------------------------------------------+
2525
| Inherited| - `invalid_message`_|
2626
| options| - `invalid_message_parameters`_|
27-
|| - `error_bubbling`_|
2827
+-------------+------------------------------------------------------------------------+
2928
| Parent type|:doc:`field</reference/forms/types/form>`|
3029
+-------------+------------------------------------------------------------------------+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp