Skip to content

Untitled #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions guides/Twig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ Enable the ``TwigBundle`` in your kernel::

public function registerBundles()
{
$bundles = array(
// ...
new Symfony\Framework\TwigBundle\Bundle(),
);
$bundles = array(
// ...
new Symfony\Framework\TwigBundle\Bundle(),
);

// ...
// ...
}

Then, configure it:
Expand Down
74 changes: 36 additions & 38 deletions guides/doctrine/MongoDB.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,26 @@ you need to customize more you can specify the complete configuration:

# config/config.yml
doctrine_odm.mongodb:
server: mongodb://localhost:27017
options:
connect: true
metadata_cache_driver: array # array, apc, xcache, memcache
server: mongodb://localhost:27017
options:
connect: true
metadata_cache_driver: array # array, apc, xcache, memcache

If you wish to use memcache to cache your metadata and you need to configure the ``Memcache`` instance you can do the following:

.. code-block:: yaml

# config/config.yml
doctrine_odm.mongodb:
server: mongodb://localhost:27017
options:
connect: true
metadata_cache_driver:
type: memcache
class: Doctrine\Common\Cache\MemcacheCache
host: localhost
port: 11211
instance_class: Memcache
server: mongodb://localhost:27017
options:
connect: true
metadata_cache_driver:
type: memcache
class: Doctrine\Common\Cache\MemcacheCache
host: localhost
port: 11211
instance_class: Memcache

Multiple Connections
~~~~~~~~~~~~~~~~~~~~
Expand All @@ -60,24 +60,24 @@ If you need multiple connections and document managers you can use the following
.. code-block:: yaml

doctrine_odm.mongodb:
default_connection: conn2
default_document_manager: dm2
metadata_cache_driver: apc
connections:
conn1:
server: mongodb://localhost:27017
options:
connect: true
conn2:
server: mongodb://localhost:27017
options:
connect: true
document_managers:
dm1:
connection: conn1
metadata_cache_driver: xcache
dm2:
connection: conn2
default_connection: conn2
default_document_manager: dm2
metadata_cache_driver: apc
connections:
conn1:
server: mongodb://localhost:27017
options:
connect: true
conn2:
server: mongodb://localhost:27017
options:
connect: true
document_managers:
dm1:
connection: conn1
metadata_cache_driver: xcache
dm2:
connection: conn2

Now you can retrieve the configured services connection services::

Expand Down Expand Up @@ -133,13 +133,11 @@ Multiple Connections:
xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services http://www.symfony-project.org/schema/dic/services/services-1.0.xsd
http://www.symfony-project.org/schema/dic/doctrine/odm/mongodb http://www.symfony-project.org/schema/dic/doctrine/odm/mongodb/mongodb-1.0.xsd">

<doctrine:mongodb
metadata_cache_driver="apc"
default_document_manager="dm2"
default_connection="dm2"
proxy_namespace="Proxies"
auto_generate_proxy_classes="true"
>
<doctrine:mongodb metadata_cache_driver="apc"
default_document_manager="dm2"
default_connection="dm2"
proxy_namespace="Proxies"
auto_generate_proxy_classes="true">
<doctrine:connections>
<doctrine:connection id="conn1" server="mongodb://localhost:27017">
<options>
Expand Down
38 changes: 19 additions & 19 deletions guides/doctrine/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ the key named ``connections``:
.. code-block:: yaml

doctrine.dbal:
default_connection: default
connections:
default:
dbname: Symfony2
user: root
password: null
host: localhost
customer:
dbname: customer
user: root
password: null
host: localhost
default_connection: default
connections:
default:
dbname: Symfony2
user: root
password: null
host: localhost
customer:
dbname: customer
user: root
password: null
host: localhost

If you have defined multiple connections you can use the ``getDatabaseConnection()`` as well
but you must pass it an argument with the name of the connection you want to get::
Expand All @@ -67,13 +67,13 @@ ORM Configuration
.. code-block:: yaml

doctrine.orm:
default_entity_manager: default
cache_driver: apc # array, apc, memcache, xcache
entity_managers:
default:
connection: default
customer:
connection: customer
default_entity_manager: default
cache_driver: apc # array, apc, memcache, xcache
entity_managers:
default:
connection: default
customer:
connection: customer

Just like the DBAL, if you have configured multiple ``EntityManager`` instances and want to
get a specific one you can use the ``getEntityManager()`` method by just passing it an argument
Expand Down
10 changes: 5 additions & 5 deletions guides/emails.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Enable ``SwiftmailerBundle`` in your kernel::

public function registerBundles()
{
$bundles = array(
// ...
new Symfony\Framework\SwiftmailerBundle\Bundle(),
);
$bundles = array(
// ...
new Symfony\Framework\SwiftmailerBundle\Bundle(),
);

// ...
// ...
}

Configuration
Expand Down
6 changes: 3 additions & 3 deletions guides/event/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ magic ``__call()`` method in the class you want to be extended like this::

// no listener was able to proces the event? The method does not exist
if (!$event->isProcessed()) {
throw new \Exception(sprintf('Call to undefined method %s::%s.', get_class($this), $method));
throw new \Exception(sprintf('Call to undefined method %s::%s.', get_class($this), $method));
}

// return the listener returned value
Expand All @@ -114,8 +114,8 @@ Then, create a class that will host the listener::
{
// we only want to respond to the calls to the 'bar' method
if ('bar' != $event['method']) {
// allow another listener to take care of this unknown method
return false;
// allow another listener to take care of this unknown method
return false;
}

// the subject object (the foo instance)
Expand Down
Loading