Guest User

Untitled

a guest
May 29th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. <?
  2. /* */
  3. /*** Doctrine - Configuration ***/
  4. /* */
  5.  
  6. // include the bootstrap for Doctrine
  7. require_once LIBRARY_PATH . '/Swamped/Doctrine.php';
  8. // setup the autoload for Doctrine
  9. spl_autoload_register(array('Doctrine', 'autoload'));
  10.  
  11.  
  12.  
  13. $dsn = 'mysql:dbname=spaceempty;host=127.0.0.1';
  14. $user = 'root';
  15. $password = 'root';
  16.  
  17. try {
  18. $dbh = new PDO($dsn, $user, $password);
  19. $conn = Doctrine_Manager::connection($dbh);
  20. } catch (PDOException $e) {
  21. echo 'Connection failed: ' . $e->getMessage();
  22. }
  23.  
  24.  
  25.  
  26. //$conn = Doctrine_Manager::connection(DSN);
  27. // set model loading mode
  28. Doctrine_Manager::getInstance()->setAttribute('model_loading', 'conservative');
  29. // load all the models into memory
  30.  
  31.  
  32. // turn on DQL Listeners
  33. Doctrine_Manager::getInstance()->setAttribute("use_dql_callbacks", true);
  34. // turning on validation
  35. Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_ALL);
Add Comment
Please, Sign In to add comment