extranet/includes/dbbootstrap.php

28 lines
992 B
PHP
Raw Normal View History

2009-05-04 14:26:54 +00:00
<?php
/**
* Bootstrap Doctrine.php, register autoloader specify
* configuration attributes and load models.
*/
require_once 'Doctrine.php';
spl_autoload_register(array('Doctrine', 'autoload'));
$manager = Doctrine_Manager::getInstance();
$manager->setAttribute( Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE );
2009-05-04 14:26:54 +00:00
$manager->setAttribute( Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, TRUE );
$manager->setAttribute( Doctrine::ATTR_USE_NATIVE_ENUM, TRUE );
/*
$manager->setCollate('utf8_unicode_ci');
$manager->setCharset('utf8');
*/
$graydonConn = Doctrine_Manager::connection('mysql://'.MYSQL_USER.':'.MYSQL_PASS.'@'.MYSQL_HOST.'/graydon', 'graydon');
$intersudConn = Doctrine_Manager::connection('mysql://'.MYSQL_USER.':'.MYSQL_PASS.'@'.MYSQL_HOST.'/intersud', 'intersud');
/*
$connection->setCollate('utf8_unicode_ci');
$connection->setCharset('utf8');
*/
2009-05-12 12:25:42 +00:00
Doctrine::loadModels(realpath(dirname(__FILE__)).'/models/graydon');
$manager->setCurrentConnection('graydon');
2009-05-04 14:26:54 +00:00
?>