Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // bootstrap.php
- use Doctrine\ORM\Tools\Setup;
- use Doctrine\ORM\EntityManager;
- require_once "vendor/autoload.php";
- // Create a simple "default" Doctrine ORM configuration for Annotations
- $isDevMode = true;
- $proxyDir = null;
- $cache = null;
- $useSimpleAnnotationReader = false;
- $config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/src/Entities"), $isDevMode, $proxyDir, $cache, $useSimpleAnnotationReader);
- // or if you prefer yaml or XML
- //$config = Setup::createXMLMetadataConfiguration(array(__DIR__."/config/xml"), $isDevMode);
- //$config = Setup::createYAMLMetadataConfiguration(array(__DIR__."/config/yaml"), $isDevMode);
- // database configuration parameters
- $conn = array(
- 'driver' => 'pdo_mysql',
- 'user' => 'root',
- 'password' => 'root',
- 'dbname' => 'user1',
- 'path' => __DIR__ . '/db.sqlite',
- );
- // obtaining the entity manager
- $entityManager = EntityManager::create($conn, $config);
Advertisement
Add Comment
Please, Sign In to add comment