Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.0' into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Feb 25, 2013
2 parents c78a518 + 6f09170 commit 7d03090
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 12 deletions.
2 changes: 1 addition & 1 deletion book/installation.rst
Expand Up @@ -156,7 +156,7 @@ If there are any issues, correct them now before moving on.

.. code-block:: bash
$ sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
$ sudo setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX app/cache app/logs
$ sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
**3. Without using ACL**
Expand Down
24 changes: 19 additions & 5 deletions cookbook/bundles/extension.rst
Expand Up @@ -293,7 +293,10 @@ configuration::
{
// ... prepare your $config variable

$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader = new XmlFileLoader(
$container,
new FileLocator(__DIR__.'/../Resources/config')
);
$loader->load('services.xml');
}

Expand All @@ -305,7 +308,10 @@ option is passed and set to true::
{
// ... prepare your $config variable

$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader = new XmlFileLoader(
$container,
new FileLocator(__DIR__.'/../Resources/config')
);

if (isset($config['enabled']) && $config['enabled']) {
$loader->load('services.xml');
Expand Down Expand Up @@ -351,14 +357,22 @@ Add the following to the ``load()`` method to do this::
{
// ... prepare your $config variable

$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader = new XmlFileLoader(
$container,
new FileLocator(__DIR__.'/../Resources/config')
);
$loader->load('services.xml');

if (!isset($config['my_type'])) {
throw new \InvalidArgumentException('The "my_type" option must be set');
throw new \InvalidArgumentException(
'The "my_type" option must be set'
);
}

$container->setParameter('acme_hello.my_service_type', $config['my_type']);
$container->setParameter(
'acme_hello.my_service_type',
$config['my_type']
);
}

Now, the user can effectively configure the service by specifying the ``my_type``
Expand Down
7 changes: 5 additions & 2 deletions cookbook/email/testing.rst
Expand Up @@ -56,8 +56,11 @@ to get information about the messages send on the previous request::
$this->assertEquals('Hello Email', $message->getSubject());
$this->assertEquals('send@example.com', key($message->getFrom()));
$this->assertEquals('recipient@example.com', key($message->getTo()));
$this->assertEquals('You should see me from the profiler!', $message->getBody());
$this->assertEquals(
'You should see me from the profiler!',
$message->getBody()
);
}
}

.. _Swiftmailer: http://swiftmailer.org/
.. _Swiftmailer: http://swiftmailer.org/
16 changes: 13 additions & 3 deletions cookbook/security/entity_provider.rst
Expand Up @@ -377,7 +377,11 @@ The code below shows the implementation of the
// if there is no record matching the criteria.
$user = $q->getSingleResult();
} catch (NoResultException $e) {
throw new UsernameNotFoundException(sprintf('Unable to find an active admin AcmeUserBundle:User object identified by "%s".', $username), null, 0, $e);
$message = sprintf(
'Unable to find an active admin AcmeUserBundle:User object identified by "%s".',
$username
);
throw new UsernameNotFoundException($message, null, 0, $e);
}
return $user;
Expand All @@ -387,15 +391,21 @@ The code below shows the implementation of the
{
$class = get_class($user);
if (!$this->supportsClass($class)) {
throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', $class));
throw new UnsupportedUserException(
sprintf(
'Instances of "%s" are not supported.',
$class
)
);
}
return $this->find($user->getId());
}
public function supportsClass($class)
{
return $this->getEntityName() === $class || is_subclass_of($class, $this->getEntityName());
return $this->getEntityName() === $class
|| is_subclass_of($class, $this->getEntityName());
}
}
Expand Down
6 changes: 5 additions & 1 deletion cookbook/service_container/event_listener.rst
Expand Up @@ -27,7 +27,11 @@ event is just one of the core kernel events::
{
// You get the exception object from the received event
$exception = $event->getException();
$message = 'My Error says: ' . $exception->getMessage() . ' with code: ' . $exception->getCode();
$message = sprintf(
'My Error says: %s with code: %s',
$exception->getMessage(),
$exception->getCode()
);

// Customize your response object to display the exception details
$response = new Response();
Expand Down

0 comments on commit 7d03090

Please sign in to comment.