Skip to content

Commit

Permalink
Merge branch '2.5'
Browse files Browse the repository at this point in the history
* 2.5:
  [#4276] Making language correction we agreed on
  Correct a typo: replace "then" by "the".
  Correct a typo: remove unnecessary "the" word.
  Remove horizontal scrollbar and change event name to follow conventions
  Remove horizontal scrollbar
  Update choice.rst
  Improve readability
  support Varnish in configuration blocks
  minor #4285 Update security.rst (placid2000)
  Update security.rst
  [Cookbook][External Parameters] Enhance description of environment variables
  Make a small grammatical adjustment
  • Loading branch information
weaverryan committed Oct 15, 2014
2 parents 25a17fe + 171f085 commit 9e0e12d
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 18 deletions.
2 changes: 1 addition & 1 deletion _exts
2 changes: 1 addition & 1 deletion book/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ will match any ``ip``, ``host`` or ``method``:
.....................

Once Symfony has decided which ``access_control`` entry matches (if any),
it then *enforces* access restrictions based on the ``roles`` and ``requires_channel``
it then *enforces* access restrictions based on the ``roles``, ``allow_if`` and ``requires_channel``
options:

* ``role`` If the user does not have the given role(s), then access is denied
Expand Down
2 changes: 1 addition & 1 deletion components/dependency_injection/definitions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Creating a new Definition
~~~~~~~~~~~~~~~~~~~~~~~~~

If you need to create a new definition rather than manipulate one retrieved
from then container then the definition class is :class:`Symfony\\Component\\DependencyInjection\\Definition`.
from the container then the definition class is :class:`Symfony\\Component\\DependencyInjection\\Definition`.

Class
~~~~~
Expand Down
14 changes: 10 additions & 4 deletions components/event_dispatcher/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,11 @@ Lazy loading listeners::
{
private $started = false;

public function myLazyListener(Event $event, $eventName, EventDispatcherInterface $dispatcher)
{
public function myLazyListener(
Event $event,
$eventName,
EventDispatcherInterface $dispatcher
) {
if (false === $this->started) {
$subscriber = new StoreSubscriber();
$dispatcher->addSubscriber($subscriber);
Expand All @@ -529,8 +532,11 @@ Dispatching another event from within a listener::

class Foo
{
public function myFooListener(Event $event, $eventName, EventDispatcherInterface $dispatcher)
{
public function myFooListener(
Event $event,
$eventName,
EventDispatcherInterface $dispatcher
) {
$dispatcher->dispatch('log', $event);

// ... more code
Expand Down
9 changes: 6 additions & 3 deletions components/event_dispatcher/traceable_dispatcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ Pass the event dispatcher to be wrapped and an instance of the
// the event dispatcher to debug
$eventDispatcher = ...;

$traceableEventDispatcher = new TraceableEventDispatcher($eventDispatcher, new Stopwatch());
$traceableEventDispatcher = new TraceableEventDispatcher(
$eventDispatcher,
new Stopwatch()
);

Now, the ``TraceableEventDispatcher`` can be used like any other event dispatcher
to register event listeners and dispatch events::
Expand All @@ -31,11 +34,11 @@ to register event listeners and dispatch events::
// register an event listener
$eventListener = ...;
$priority = ...;
$traceableEventDispatcher->addListener('the-event-name', $eventListener, $priority);
$traceableEventDispatcher->addListener('event.the_name', $eventListener, $priority);

// dispatch an event
$event = ...;
$traceableEventDispatcher->dispatch('the-event-name', $event);
$traceableEventDispatcher->dispatch('event.the_name', $event);

After your application has been processed, you can use the
:method:`Symfony\\Component\\EventDispatcher\\Debug\\TraceableEventDispatcherInterface::getCalledListeners`
Expand Down
2 changes: 1 addition & 1 deletion components/http_foundation/session_configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ which runs reasonably frequently. The ``cookie_lifetime`` would be set to a
relatively high value, and the garbage collection ``gc_maxlifetime`` would be set
to destroy sessions at whatever the desired idle period is.

The other option is to specifically checking if a session has expired after the
The other option is specifically check if a session has expired after the
session is started. The session can be destroyed as required. This method of
processing can allow the expiry of sessions to be integrated into the user
experience, for example, by displaying a message.
Expand Down
11 changes: 11 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# adding PhpLexer
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer
from pygments.lexers.agile import RubyLexer

# -- General configuration -----------------------------------------------------

Expand Down Expand Up @@ -100,6 +101,15 @@
lexers['php-annotations'] = PhpLexer(startinline=True)
lexers['php-standalone'] = PhpLexer(startinline=True)
lexers['php-symfony'] = PhpLexer(startinline=True)
lexers['varnish2'] = RubyLexer()
lexers['varnish3'] = RubyLexer()
lexers['varnish4'] = RubyLexer()

config_block = {
'varnish2': 'Varnish 2',
'varnish3': 'Varnish 3',
'varnish4': 'Varnish 4'
}

# use PHP as the primary domain
primary_domain = 'php'
Expand Down Expand Up @@ -264,3 +274,4 @@

# Use PHP syntax highlighting in code examples by default
highlight_language='php'

2 changes: 1 addition & 1 deletion cookbook/bundles/extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ container, to ensure all services and parameters are also added to the actual
container.

In the ``load()`` method, you can use PHP code to register service definitions,
but it is more common if you put the these definitions in a configuration file
but it is more common if you put these definitions in a configuration file
(using the Yaml, XML or PHP format). Luckily, you can use the file loaders in
the extension!

Expand Down
18 changes: 15 additions & 3 deletions cookbook/configuration/external_parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ Environment Variables
---------------------

Symfony will grab any environment variable prefixed with ``SYMFONY__`` and
set it as a parameter in the service container. Double underscores are replaced
with a period, as a period is not a valid character in an environment variable
name.
set it as a parameter in the service container. Some transformations are
applied to the resulting parameter name:

* ``SYMFONY__`` prefix is removed;
* Parameter name is lowercased;
* Double underscores are replaced with a period, as a period is not
a valid character in an environment variable name.

For example, if you're using Apache, environment variables can be set using
the following ``VirtualHost`` configuration:
Expand Down Expand Up @@ -94,6 +98,14 @@ You can now reference these parameters wherever you need them.
)
));
.. note::

Even in debug mode, setting or changing an environment variable
requires your cache to be cleared to make the parameter available.
In debug mode, this is required since only a change to a configuration
file that is loaded by Symfony triggers your configuration to be
re-evaluated.

Constants
---------

Expand Down
5 changes: 3 additions & 2 deletions cookbook/event_dispatcher/before_after_filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ event listeners, you can learn more about them at :doc:`/cookbook/service_contai
$controller = $event->getController();

/*
* $controller passed can be either a class or a Closure. This is not usual in Symfony but it may happen.
* $controller passed can be either a class or a Closure.
* This is not usual in Symfony but it may happen.
* If it is a class, it comes in array format
*/
if (!is_array($controller)) {
Expand Down Expand Up @@ -189,7 +190,7 @@ want.
After Filters with the ``kernel.response`` Event
------------------------------------------------

In addition to having a "hook" that's executed before your controller, you
In addition to having a "hook" that's executed *before* your controller, you
can also add a hook that's executed *after* your controller. For this example,
imagine that you want to add a sha1 hash (with a salt using that token) to
all responses that have passed this token authentication.
Expand Down
2 changes: 1 addition & 1 deletion reference/forms/types/choice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ With this option you can also allow float values to be selected as data.
// ...
$builder->add('status', 'choice', array(
'choice_list' => new ChoiceList(array(1, 0.5), array('Full', 'Half')
'choice_list' => new ChoiceList(array(1, 0.5), array('Full', 'Half'))
));
.. include:: /reference/forms/types/options/empty_value.rst.inc
Expand Down

0 comments on commit 9e0e12d

Please sign in to comment.