Skip to content

Commit 678a921

Browse files
committed
Docs re-org and removal of small sections
1 parent b182662 commit 678a921

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+381
-292
lines changed

_build/redirection_map

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,20 @@
7676
/book/configuration /configuration
7777
/book/propel /propel/propel
7878
/book/performance /performance
79-
/cookbook/assetic/apply_to_option /assetic/apply_to_option
80-
/cookbook/assetic/asset_management /assetic/asset_management
81-
/cookbook/assetic/index /assetic
82-
/cookbook/assetic/jpeg_optimize /assetic/jpeg_optimize
83-
/cookbook/assetic/php /assetic/php
84-
/cookbook/assetic/uglifyjs /assetic/uglifyjs
85-
/cookbook/assetic/yuicompressor /assetic/yuicompressor
79+
/cookbook/assetic/apply_to_option /frontend/assetic/apply_to_option
80+
/cookbook/assetic/asset_management /frontend/assetic/asset_management
81+
/cookbook/assetic/index /frontend/assetic
82+
/cookbook/assetic/jpeg_optimize /frontend/assetic/jpeg_optimize
83+
/cookbook/assetic/php /frontend/assetic/php
84+
/cookbook/assetic/uglifyjs /frontend/assetic/uglifyjs
85+
/cookbook/assetic/yuicompressor /frontend/assetic/yuicompressor
86+
/assetic /frontend/assetic
87+
/assetic/apply_to_option /frontend/assetic/apply_to_option
88+
/assetic/asset_management /frontend/assetic/asset_management
89+
/assetic/jpeg_optimize /frontend/assetic/jpeg_optimize
90+
/assetic/php /frontend/assetic/php
91+
/assetic/uglifyjs /frontend/assetic/uglifyjs
92+
/assetic/yuicompressor /frontend/assetic/yuicompressor
8693
/cookbook/bundles/best_practices /bundles/best_practices
8794
/cookbook/bundles/configuration /bundles/configuration
8895
/cookbook/bundles/extension /bundles/extension
@@ -150,7 +157,8 @@
150157
/cookbook/event_dispatcher/event_listener /event_dispatcher
151158
/cookbook/event_dispatcher/index /event_dispatcher
152159
/cookbook/event_dispatcher/method_behavior /event_dispatcher/method_behavior
153-
/cookbook/expressions /expressions/expressions
160+
/cookbook/expressions /security/expressions
161+
/expressions /security/expressions
154162
/cookbook/form/create_custom_field_type /form/create_custom_field_type
155163
/cookbook/form/create_form_type_extension /form/create_form_type_extension
156164
/cookbook/form/data_transformers /form/data_transformers
@@ -181,10 +189,10 @@
181189
/cookbook/profiler/matchers /profiler/matchers
182190
/cookbook/profiler/profiling_data /profiler/profiling_data
183191
/cookbook/profiler/storage /profiler/storage
184-
/cookbook/psr7 /request/psr7
192+
/cookbook/psr7 /components/psr7
185193
/cookbook/request/index /request
186-
/cookbook/request/load_balancer_reverse_proxy /request/load_balancer_reverse_proxy
187-
/cookbook/request/mime_type /request/mime_type
194+
/cookbook/request/load_balancer_reverse_proxy /deployment/proxies
195+
/cookbook/request/mime_type /reference/configuration/framework#formats
188196
/cookbook/routing/conditions /routing/conditions
189197
/cookbook/routing/custom_route_loader /routing/custom_route_loader
190198
/cookbook/routing/debug /routing/debug
@@ -303,6 +311,7 @@
303311
/components/form/type_guesser /form/type_guesser
304312
/components/http_foundation/index /components/http_foundation
305313
/components/http_foundation/introduction /components/http_foundation
314+
/components/http_foundation/trusting_proxies /deployment/proxies
306315
/components/http_kernel/introduction /components/http_kernel
307316
/components/http_kernel/index /components/http_kernel
308317
/components/property_access/introduction /components/property_access
@@ -327,3 +336,4 @@
327336
/form /forms
328337
/testing/simulating_authentication /testing/http_authentication
329338
/validation/group_service_resolver /form/validation_group_service_resolver
339+
/request/load_balancer_reverse_proxy /deployment/proxies

best_practices/web-assets.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ tools like GruntJS.
4949
Use Assetic to compile, combine and minimize web assets, unless you're
5050
comfortable with frontend tools like GruntJS.
5151

52-
:doc:`Assetic </assetic/asset_management>` is an asset manager capable
52+
:doc:`Assetic </frontend/assetic/asset_management>` is an asset manager capable
5353
of compiling assets developed with a lot of different frontend technologies
5454
like LESS, Sass and CoffeeScript. Combining all your assets with Assetic is a
5555
matter of wrapping all the assets with a single Twig tag:
@@ -87,8 +87,8 @@ Learn More about Assetic
8787
------------------------
8888

8989
Assetic can also minimize CSS and JavaScript assets
90-
:doc:`using UglifyCSS/UglifyJS </assetic/uglifyjs>` to speed up your
91-
websites. You can even :doc:`compress images </assetic/jpeg_optimize>`
90+
:doc:`using UglifyCSS/UglifyJS </frontend/assetic/uglifyjs>` to speed up your
91+
websites. You can even :doc:`compress images </frontend/assetic/jpeg_optimize>`
9292
with Assetic to reduce their size before serving them to the user. Check out
9393
the `official Assetic documentation`_ to learn more about all the available
9494
features.

bundles/best_practices.rst

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Bundle Name
3131
A bundle is also a PHP namespace. The namespace must follow the `PSR-0`_ or
3232
`PSR-4`_ interoperability standards for PHP namespaces and class names: it starts
3333
with a vendor segment, followed by zero or more category segments, and it ends
34-
with the namespace short name, which must end with a ``Bundle`` suffix.
34+
with the namespace short name, which must end with ``Bundle``.
3535

3636
A namespace becomes a bundle as soon as you add a bundle class to it. The
3737
bundle class name must follow these simple rules:
@@ -48,8 +48,8 @@ Here are some valid bundle namespaces and class names:
4848
========================== ==================
4949
Namespace Bundle Class Name
5050
========================== ==================
51-
``Acme\Bundle\BlogBundle`` ``AcmeBlogBundle``
52-
``Acme\BlogBundle`` ``AcmeBlogBundle``
51+
``Acme\Bundle\BlogBundle`` AcmeBlogBundle
52+
``Acme\BlogBundle`` AcmeBlogBundle
5353
========================== ==================
5454

5555
By convention, the ``getName()`` method of the bundle class should return the
@@ -58,8 +58,7 @@ class name.
5858
.. note::
5959

6060
If you share your bundle publicly, you must use the bundle class name as
61-
the name of the repository (``AcmeBlogBundle`` and not ``BlogBundle``
62-
for instance).
61+
the name of the repository (AcmeBlogBundle and not BlogBundle for instance).
6362

6463
.. note::
6564

@@ -68,7 +67,7 @@ class name.
6867
:class:`Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle`.
6968

7069
Each bundle has an alias, which is the lower-cased short version of the bundle
71-
name using underscores (``acme_blog`` for ``AcmeBlogBundle``). This alias
70+
name using underscores (``acme_blog`` for AcmeBlogBundle). This alias
7271
is used to enforce uniqueness within a project and for defining bundle's
7372
configuration options (see below for some usage examples).
7473

@@ -105,8 +104,8 @@ that automated tools can rely on:
105104
bundles are published under the MIT license, but you can `choose any license`_;
106105
* ``Resources/doc/index.rst``: The root file for the Bundle documentation.
107106

108-
The depth of sub-directories should be kept to the minimum for most used
109-
classes and files (two levels maximum).
107+
The depth of subdirectories should be kept to a minimum for the most used
108+
classes and files. Two levels is the maximum.
110109

111110
The bundle directory is read-only. If you need to write temporary files, store
112111
them under the ``cache/`` or ``log/`` directory of the host application. Tools
@@ -138,9 +137,9 @@ Classes
138137
-------
139138

140139
The bundle directory structure is used as the namespace hierarchy. For
141-
instance, a ``ContentController`` controller is stored in
142-
``Acme/BlogBundle/Controller/ContentController.php`` and the fully qualified
143-
class name is ``Acme\BlogBundle\Controller\ContentController``.
140+
instance, a ``ContentController`` controller which is stored in
141+
``Acme/BlogBundle/Controller/ContentController.php`` would have the fully
142+
qualified class name of ``Acme\BlogBundle\Controller\ContentController``.
144143

145144
All classes and files must follow the :doc:`Symfony coding standards </contributing/code/standards>`.
146145

@@ -158,8 +157,8 @@ Vendors
158157
A bundle must not embed third-party PHP libraries. It should rely on the
159158
standard Symfony autoloading instead.
160159

161-
A bundle should not embed third-party libraries written in JavaScript, CSS or
162-
any other language.
160+
A bundle should also not embed third-party libraries written in JavaScript,
161+
CSS or any other language.
163162

164163
Tests
165164
-----
@@ -183,10 +182,13 @@ Documentation
183182

184183
All classes and functions must come with full PHPDoc.
185184

186-
Extensive documentation should also be provided in the
187-
:doc:`reStructuredText </contributing/documentation/format>` format, under
188-
the ``Resources/doc/`` directory; the ``Resources/doc/index.rst`` file is
189-
the only mandatory file and must be the entry point for the documentation.
185+
Extensive documentation should also be provided in the ``Resources/doc/``
186+
directory.
187+
The index file (for example ``Resources/doc/index.rst`` or
188+
``Resources/doc/index.md``) is the only mandatory file and must be the entry
189+
point for the documentation. The
190+
:doc:`reStructuredText (rST) </contributing/documentation/format>` is the format
191+
used to render the documentation on symfony.com.
190192

191193
Installation Instructions
192194
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -232,7 +234,6 @@ following standardized instructions in your ``README.md`` file.
232234
{
233235
$bundles = array(
234236
// ...
235-
236237
new <vendor>\<bundle-name>\<bundle-long-name>(),
237238
);
238239
@@ -399,9 +400,9 @@ The ``composer.json`` file should include at least the following metadata:
399400
``name``
400401
Consists of the vendor and the short bundle name. If you are releasing the
401402
bundle on your own instead of on behalf of a company, use your personal name
402-
(e.g. ``johnsmith/blog-bundle``). The bundle short name excludes the vendor
403-
name and separates each word with an hyphen. For example: ``AcmeBlogBundle``
404-
is transformed into ``blog-bundle`` and ``AcmeSocialConnectBundle`` is
403+
(e.g. ``johnsmith/blog-bundle``). Exclude the vendor name from the bundle
404+
short name and separate each word with an hyphen. For example: AcmeBlogBundle
405+
is transformed into ``blog-bundle`` and AcmeSocialConnectBundle is
405406
transformed into ``social-connect-bundle``.
406407

407408
``description``
@@ -411,8 +412,7 @@ The ``composer.json`` file should include at least the following metadata:
411412
Use the ``symfony-bundle`` value.
412413

413414
``license``
414-
``MIT`` is the preferred license for Symfony bundles, but you can use any
415-
other license.
415+
a string (or array of strings) with a `valid license identifier`_, such as ``MIT``.
416416

417417
``autoload``
418418
This information is used by Symfony to load the classes of the bundle. The
@@ -497,3 +497,4 @@ Learn more
497497
.. _`Semantic Versioning Standard`: http://semver.org/
498498
.. _`Packagist`: https://packagist.org/
499499
.. _`choose any license`: http://choosealicense.com/
500+
.. _`valid license identifier`: https://spdx.org/licenses/

components/expression_language.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ Learn More
119119
:maxdepth: 1
120120
:glob:
121121

122-
/expressions
123122
/components/expression_language/*
124123
/service_container/expression_language
125124
/reference/constraints/Expression

components/filesystem.rst

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,13 @@ exists
7979
~~~~~~
8080

8181
:method:`Symfony\\Component\\Filesystem\\Filesystem::exists` checks for the
82-
presence of all files or directories and returns ``false`` if a file is missing::
82+
presence of one or more files or directories and returns ``false`` if any of
83+
them is missing::
8384

8485
// this directory exists, return true
8586
$fs->exists('/tmp/photos');
8687

87-
// rabbit.jpg exists, bottle.png does not exists, return false
88+
// rabbit.jpg exists, bottle.png does not exist, return false
8889
$fs->exists(array('rabbit.jpg', 'bottle.png'));
8990

9091
.. note::
@@ -95,10 +96,11 @@ presence of all files or directories and returns ``false`` if a file is missing:
9596
copy
9697
~~~~
9798

98-
:method:`Symfony\\Component\\Filesystem\\Filesystem::copy` is used to copy
99-
files. If the target already exists, the file is copied only if the source
100-
modification date is later than the target. This behavior can be overridden by
101-
the third boolean argument::
99+
:method:`Symfony\\Component\\Filesystem\\Filesystem::copy` makes a copy of a
100+
single file (use :method:`Symfony\\Component\\Filesystem\\Filesystem::mirror` to
101+
copy directories). If the target already exists, the file is copied only if the
102+
source modification date is later than the target. This behavior can be overridden
103+
by the third boolean argument::
102104

103105
// works only if image-ICC has been modified after image.jpg
104106
$fs->copy('image-ICC.jpg', 'image.jpg');
@@ -128,8 +130,8 @@ your own with the second argument. The third argument is the access time::
128130
chown
129131
~~~~~
130132

131-
:method:`Symfony\\Component\\Filesystem\\Filesystem::chown` is used to change
132-
the owner of a file. The third argument is a boolean recursive option::
133+
:method:`Symfony\\Component\\Filesystem\\Filesystem::chown` changes the owner of
134+
a file. The third argument is a boolean recursive option::
133135

134136
// set the owner of the lolcat video to www-data
135137
$fs->chown('lolcat.mp4', 'www-data');
@@ -144,8 +146,8 @@ the owner of a file. The third argument is a boolean recursive option::
144146
chgrp
145147
~~~~~
146148

147-
:method:`Symfony\\Component\\Filesystem\\Filesystem::chgrp` is used to change
148-
the group of a file. The third argument is a boolean recursive option::
149+
:method:`Symfony\\Component\\Filesystem\\Filesystem::chgrp` changes the group of
150+
a file. The third argument is a boolean recursive option::
149151

150152
// set the group of the lolcat video to nginx
151153
$fs->chgrp('lolcat.mp4', 'nginx');
@@ -160,8 +162,8 @@ the group of a file. The third argument is a boolean recursive option::
160162
chmod
161163
~~~~~
162164

163-
:method:`Symfony\\Component\\Filesystem\\Filesystem::chmod` is used to change
164-
the mode of a file. The fourth argument is a boolean recursive option::
165+
:method:`Symfony\\Component\\Filesystem\\Filesystem::chmod` changes the mode or
166+
permissions of a file. The fourth argument is a boolean recursive option::
165167

166168
// set the mode of the video to 0600
167169
$fs->chmod('video.ogg', 0600);
@@ -176,8 +178,8 @@ the mode of a file. The fourth argument is a boolean recursive option::
176178
remove
177179
~~~~~~
178180

179-
:method:`Symfony\\Component\\Filesystem\\Filesystem::remove` is used to remove
180-
files, symlinks, directories easily::
181+
:method:`Symfony\\Component\\Filesystem\\Filesystem::remove` deletes files,
182+
directories and symlinks::
181183

182184
$fs->remove(array('symlink', '/path/to/directory', 'activity.log'));
183185

@@ -189,8 +191,8 @@ files, symlinks, directories easily::
189191
rename
190192
~~~~~~
191193

192-
:method:`Symfony\\Component\\Filesystem\\Filesystem::rename` is used to rename
193-
files and directories::
194+
:method:`Symfony\\Component\\Filesystem\\Filesystem::rename` changes the name
195+
of a single file or directory::
194196

195197
// rename a file
196198
$fs->rename('/tmp/processed_video.ogg', '/path/to/store/video_647.ogg');
@@ -213,8 +215,8 @@ support symbolic links, a third boolean argument is available::
213215
makePathRelative
214216
~~~~~~~~~~~~~~~~
215217

216-
:method:`Symfony\\Component\\Filesystem\\Filesystem::makePathRelative` returns
217-
the relative path of a directory given another one::
218+
:method:`Symfony\\Component\\Filesystem\\Filesystem::makePathRelative` takes two
219+
absolute paths and returns the relative path from the second path to the first one::
218220

219221
// returns '../'
220222
$fs->makePathRelative(
@@ -227,8 +229,10 @@ the relative path of a directory given another one::
227229
mirror
228230
~~~~~~
229231

230-
:method:`Symfony\\Component\\Filesystem\\Filesystem::mirror` mirrors a
231-
directory::
232+
:method:`Symfony\\Component\\Filesystem\\Filesystem::mirror` copies all the
233+
contents of the source directory into the target one (use the
234+
:method:`Symfony\\Component\\Filesystem\\Filesystem::copy` method to copy single
235+
files)::
232236

233237
$fs->mirror('/path/to/source', '/path/to/target');
234238

@@ -253,8 +257,8 @@ dumpFile
253257
.. versionadded:: 2.3
254258
The ``dumpFile()`` was introduced in Symfony 2.3.
255259

256-
:method:`Symfony\\Component\\Filesystem\\Filesystem::dumpFile` allows you to
257-
dump contents to a file. It does this in an atomic manner: it writes a temporary
260+
:method:`Symfony\\Component\\Filesystem\\Filesystem::dumpFile` saves the given
261+
contents into a file. It does this in an atomic manner: it writes a temporary
258262
file first and then moves it to the new file location when it's finished.
259263
This means that the user will always see either the complete old file or
260264
complete new file (but never a partially-written file)::

components/finder.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ the Finder instance.
5555
:phpfunction:`iterator_to_array` method, or get the number of items with
5656
:phpfunction:`iterator_count`.
5757

58+
.. caution::
59+
60+
The ``Finder`` object doesn't reset its internal state automatically.
61+
This means that you need to create a new instance if you do not want
62+
get mixed results.
63+
5864
.. caution::
5965

6066
When searching through multiple locations passed to the
@@ -83,7 +89,7 @@ Search in several locations by chaining calls to
8389
:method:`Symfony\\Component\\Finder\\Finder::in`::
8490

8591
// search inside *both* directories
86-
$finder->files()->in(array(__DIR__, '/elsewhere'));
92+
$finder->in(array(__DIR__, '/elsewhere'));
8793

8894
// same as above
8995
$finder->in(__DIR__)->in('/elsewhere');

components/http_foundation.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,9 @@ UTF-8.
356356
Sending the Response
357357
~~~~~~~~~~~~~~~~~~~~
358358

359-
Before sending the Response, you can ensure that it is compliant with the HTTP
360-
specification by calling the
361-
:method:`Symfony\\Component\\HttpFoundation\\Response::prepare` method::
359+
Before sending the Response, you can optionally call the
360+
:method:`Symfony\\Component\\HttpFoundation\\Response::prepare` method to fix any
361+
incompatibility with the HTTP specification (e.g. a wrong ``Content-Type`` header)::
362362

363363
$response->prepare($request);
364364

@@ -611,7 +611,6 @@ Learn More
611611
/components/http_foundation/*
612612
/controller
613613
/controller/*
614-
/request/*
615614
/session/*
616615
/http_cache/*
617616

components/http_foundation/trusting_proxies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Trusting Proxies
77
.. tip::
88

99
If you're using the Symfony Framework, start by reading
10-
:doc:`/request/load_balancer_reverse_proxy`.
10+
:doc:`/deployment/proxies`.
1111

1212
If you find yourself behind some sort of proxy - like a load balancer - then
1313
certain header information may be sent to you using special ``X-Forwarded-*``

0 commit comments

Comments
 (0)