Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- /* */
- /*** Doctrine - Configuration ***/
- /* */
- // include the bootstrap for Doctrine
- require_once LIBRARY_PATH . '/Swamped/Doctrine.php';
- // setup the autoload for Doctrine
- spl_autoload_register(array('Doctrine', 'autoload'));
- $dsn = 'mysql:dbname=spaceempty;host=127.0.0.1';
- $user = 'root';
- $password = 'root';
- try {
- $dbh = new PDO($dsn, $user, $password);
- $conn = Doctrine_Manager::connection($dbh);
- } catch (PDOException $e) {
- echo 'Connection failed: ' . $e->getMessage();
- }
- //$conn = Doctrine_Manager::connection(DSN);
- // set model loading mode
- Doctrine_Manager::getInstance()->setAttribute('model_loading', 'conservative');
- // load all the models into memory
- // turn on DQL Listeners
- Doctrine_Manager::getInstance()->setAttribute("use_dql_callbacks", true);
- // turning on validation
- Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_VALIDATE, Doctrine::VALIDATE_ALL);
Add Comment
Please, Sign In to add comment