config.php 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. sfConfig::set('sf_orm', 'doctrine');
  3. if (!sfConfig::get('sf_admin_module_web_dir'))
  4. {
  5. sfConfig::set('sf_admin_module_web_dir', '/sfDoctrinePlugin');
  6. }
  7. if (sfConfig::get('sf_web_debug'))
  8. {
  9. require_once dirname(__FILE__).'/../lib/debug/sfWebDebugPanelDoctrine.class.php';
  10. $this->dispatcher->connect('debug.web.load_panels', array('sfWebDebugPanelDoctrine', 'listenToAddPanelEvent'));
  11. }
  12. require_once sfConfig::get('sfDoctrinePlugin_doctrine_lib_path', dirname(__FILE__).'/../lib/vendor/doctrine/Doctrine.php');
  13. spl_autoload_register(array('Doctrine', 'autoload'));
  14. $manager = Doctrine_Manager::getInstance();
  15. $manager->setAttribute('export', 'all');
  16. $manager->setAttribute('validate', 'all');
  17. $manager->setAttribute('recursive_merge_fixtures', true);
  18. $manager->setAttribute('auto_accessor_override', true);
  19. $manager->setAttribute('autoload_table_classes', true);
  20. $configuration = sfProjectConfiguration::getActive();
  21. if (method_exists($configuration, 'configureDoctrine'))
  22. {
  23. $configuration->configureDoctrine($manager);
  24. }