Koshceyshka

Untitled

Dec 14th, 2020
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.67 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. use Doctrine\ORM\Tools\Setup;
  5. use Doctrine\ORM\EntityManager;
  6.  
  7. require_once "vendor/autoload.php";
  8.  
  9. // Create a simple "default" Doctrine ORM configuration for Annotations
  10. $isDevMode = false;
  11. $proxyDir = null;
  12. $cache = null;
  13. $useSimpleAnnotationReader = false;
  14. $config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/src/entities"), $isDevMode, $proxyDir, $cache, $useSimpleAnnotationReader);
  15. // database configuration parameters
  16. $conn = array(
  17.     'driver' => 'pdo_mysql',
  18.     'user' => 'root',
  19.     'password' => 'root',
  20.     'dbname' => 'user1',
  21. );
  22.  
  23. // obtaining the entity manager
  24. $entityManager = EntityManager::create($conn, $config);
Advertisement
Add Comment
Please, Sign In to add comment