Created
November 28, 2012 01:00
-
-
Save PhazeonPhoenix/4158310 to your computer and use it in GitHub Desktop.
Enable MongoDB in symfony2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function init() { | |
parent::init(); | |
if ($this->debug) { | |
// Disable deprecated warnings so Doctrine\MongoDB will work | |
error_reporting(E_ALL & ~E_DEPRECATED ); | |
} | |
} | |
public function registerBundles() | |
{ | |
$bundles = array( | |
// ... | |
new Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle(), | |
); | |
// ... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver; | |
AnnotationDriver::registerAnnotationClasses(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"doctrine/mongodb-odm-bundle": "3.0.*" | |
}, | |
"minimum-stability": "dev" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
doctrine_mongodb: | |
connections: | |
default: | |
server: mongodb://localhost:27017 | |
options: {} | |
default_database: test_database | |
document_managers: | |
default: | |
auto_mapping: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment