8000 minor #3642 Fixed some typos and formatting issues (javiereguiluz) · dunglas/symfony-docs@69ac21b · GitHub
[go: up one dir, main page]

Skip to content

Commit 69ac21b

Browse files
committed
minor symfony#3642 Fixed some typos and formatting issues (javiereguiluz)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes symfony#3642). Discussion ---------- Fixed some typos and formatting issues | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3+ | Fixed tickets | no Commits ------- ce6fc73 Minor corrections 9a3b12f Fixed some typos and formatting issues
2 parents 93c35d0 + 8def829 commit 69ac21b

File tree

2 files changed

+29
-27
lines changed

2 files changed

+29
-27
lines changed

components/http_foundation/session_configuration.rst

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ Save Handlers
1313
~~~~~~~~~~~~~
1414

1515
The PHP session workflow has 6 possible operations that may occur. The normal
16-
session follows `open`, `read`, `write` and `close`, with the possibility of
17-
`destroy` and `gc` (garbage collection which will expire any old sessions: `gc`
18-
is called randomly according to PHP's configuration and if called, it is invoked
19-
after the `open` operation). You can read more about this at
16+
session follows ``open``, ``read``, ``write`` and ``close``, with the possibility
17+
of ``destroy`` and ``gc`` (garbage collection which will expire any old sessions:
18+
``gc`` is called randomly according to PHP's configuration and if called, it is
19+
invoked after the ``open`` operation). You can read more about this at
2020
`php.net/session.customhandler`_
2121

2222
Native PHP Save Handlers
2323
------------------------
2424

25-
So-called 'native' handlers, are save handlers which are either compiled into
25+
So-called native handlers, are save handlers which are either compiled into
2626
PHP or provided by PHP extensions, such as PHP-Sqlite, PHP-Memcached and so on.
2727

2828
All native save handlers are internal to PHP and as such, have no public facing API.
@@ -50,14 +50,16 @@ Example usage::
5050

5151
.. note::
5252

53-
With the exception of the ``files`` handler which is built into PHP and always available,
54-
the availability of the other handlers depends on those PHP extensions being active at runtime.
53+
With the exception of the ``files`` handler which is built into PHP and
54+
always available, the availability of the other handlers depends on those
55+
PHP extensions being active at runtime.
5556

5657
.. note::
5758

58-
Native save handlers provide a quick solution to session storage, however, in complex systems
59-
where you need more control, custom save handlers may provide more freedom and flexibility.
60-
Symfony2 provides several implementations which you may further customize as required.
59+
Native save handlers provide a quick solution to session storage, however,
60+
in complex systems where you need more control, custom save handlers may
61+
provide more freedom and flexibility. Symfony2 provides several implementations
62+
which you may further customize as required.
6163

6264
Custom Save Handlers
6365
--------------------
@@ -183,14 +185,14 @@ session is started. The session can be destroyed as required. This method of
183185
processing can allow the expiry of sessions to be integrated into the user
184186
experience, for example, by displaying a message.
185187

186-
Symfony2 records some basic meta-data about each session to give you complete
188+
Symfony2 records some basic metadata about each session to give you complete
187189
freedom in this area.
188190

189-
Session meta-data
190-
~~~~~~~~~~~~~~~~~
191+
Session metadata
192+
~~~~~~~~~~~~~~~~
191193

192-
Sessions are decorated with some basic meta-data to enable fine control over the
193-
security settings. The session object has a getter for the meta-data,
194+
Sessions are decorated with some basic metadata to enable fine control over the
195+
security settings. The session object has a getter for the metadata,
194196
:method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getMetadataBag` which
195197
exposes an instance of :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\MetadataBag`::
196198

@@ -199,7 +201,7 @@ exposes an instance of :class:`Symfony\\Component\\HttpFoundation\\Session\\Stor
199201

200202
Both methods return a Unix timestamp (relative to the server).
201203

202-
This meta-data can be used to explicitly expire a session on access, e.g.::
204+
This metadata can be used to explicitly expire a session on access, e.g.::
203205

204206
$session->start();
205207
if (time() - $session->getMetadataBag()->getLastUsed() > $maxIdleTime) {
@@ -220,15 +222,15 @@ PHP 5.4 compatibility
220222

221223
Since PHP 5.4.0, :phpclass:`SessionHandler` and :phpclass:`SessionHandlerInterface`
222224
are available. Symfony provides forward compatibility for the :phpclass:`SessionHandlerInterface`
223-
so it can be used under PHP 5.3. This greatly improves inter-operability with other
225+
so it can be used under PHP 5.3. This greatly improves interoperability with other
224226
libraries.
225227

226228
:phpclass:`SessionHandler` is a special PHP internal class which exposes native save
227229
handlers to PHP user-space.
228230

229231
In order to provide a solution for those using PHP 5.4, Symfony2 has a special
230232
class called :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeSessionHandler`
231-
which under PHP 5.4, extends from `\SessionHandler` and under PHP 5.3 is just a
233+
which under PHP 5.4, extends from ``\SessionHandler`` and under PHP 5.3 is just a
232234
empty base class. This provides some interesting opportunities to leverage
233235
PHP 5.4 functionality if it is available.
234236

@@ -251,12 +253,12 @@ wrapped by one.
251253

252254
:class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\NativeProxy`
253255
is used automatically under PHP 5.3 when internal PHP save handlers are specified
254-
using the `Native*SessionHandler` classes, while
256+
using the ``Native*SessionHandler`` classes, while
255257
:class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\Handler\\SessionHandlerProxy`
256258
will be used to wrap any custom save handlers, that implement :phpclass:`SessionHandlerInterface`.
257259

258260
From PHP 5.4 and above, all session handlers implement :phpclass:`SessionHandlerInterface`
259-
including `Native*SessionHandler` classes which inherit from :phpclass:`SessionHandler`.
261+
including ``Native*SessionHandler`` classes which inherit from :phpclass:`SessionHandler`.
260262

261263
The proxy mechanism allows you to get more deeply involved in session save handler
262264
classes. A proxy for example could be used to encrypt any session transaction

components/http_foundation/sessions.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ an array. A few methods exist for "Bag" management:
121121
Gets the :class:`Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface`.
122122
This is just a shortcut for convenience.
123123

124-
Session meta-data
124+
Session metadata
125125

126126
* :method:`Symfony\\Component\\HttpFoundation\\Session\\Session::getMetadataBag`:
127127
Gets the :class:`Symfony\\Component\\HttpFoundation\\Session\\Storage\\MetadataBag`
@@ -132,16 +132,16 @@ Session Data Management
132132

133133
PHP's session management requires the use of the ``$_SESSION`` super-global,
134134
however, this interferes somewhat with code testability and encapsulation in a
135-
OOP paradigm. To help overcome this, Symfony2 uses 'session bags' linked to the
136-
session to encapsulate a specific dataset of 'attributes' or 'flash messages'.
135+
OOP paradigm. To help overcome this, Symfony2 uses *session bags* linked to the
136+
session to encapsulate a specific dataset of attributes or flash messages.
137137

138138
This approach also mitigates namespace pollution within the ``$_SESSION``
139139
super-global because each bag stores all its data under a unique namespace.
140140
This allows Symfony2 to peacefully co-exist with other applications or libraries
141141
that might use the ``$_SESSION`` super-global and all data remains completely
142142
compatible with Symfony2's session management.
143143

144-
Symfony2 provides 2 kinds of storage bags, with two separate implementations.
144+
Symfony2 provides two kinds of storage bags, with two separate implementations.
145145
Everything is written against interfaces so you may extend or create your own
146146
bag types if necessary.
147147

@@ -172,11 +172,11 @@ and remember me login settings or other user based state information.
172172
* :class:`Symfony\\Component\\HttpFoundation\\Session\\Attribute\\NamespacedAttributeBag`
173173
This implementation allows for attributes to be stored in a structured namespace.
174174

175-
Any plain `key => value` storage system is limited in the extent to which
175+
Any plain key-value storage system is limited in the extent to which
176176
complex data can be stored since each key must be unique. You can achieve
177177
namespacing by introducing a naming convention to the keys so different parts of
178-
your application could operate without clashing. For example, `module1.foo` and
179-
`module2.foo`. However, sometimes this is not very practical when the attributes
178+
your application could operate without clashing. For example, ``module1.foo`` and
179+
``module2.foo``. However, sometimes this is not very practical when the attributes
180180
data is an array, for example a set of tokens. In this case, managing the array
181181
becomes a burden because you have to retrieve the array then process it and
182182
store it again::

0 commit comments

Comments
 (0)
0