<?php require_once realpath(dirname(__FILE__)).'/../config/prepend.php'; require_once 'lib/doctrine/Doctrine.php'; spl_autoload_register(array('Doctrine', 'autoload')); $dbs = array('graydon', 'intersud', 'sdv1'); $dsn = 'mysql://'.MYSQL_USER.':'.MYSQL_PASS.'@'.MYSQL_HOST; $modelsPath = PATH_DATA.'/models'; foreach($dbs as $db) { ${$db.'Conn'} = Doctrine_Manager::connection($dsn.'/'.$db, $db); } $manager = Doctrine_Manager::getInstance(); $manager->setAttribute( Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE); $manager->setAttribute( Doctrine::ATTR_AUTO_ACCESSOR_OVERRIDE, TRUE ); $manager->setAttribute( Doctrine::ATTR_USE_NATIVE_ENUM, TRUE); if(!file_exists($modelsPath)) mkdir($modelsPath); foreach($dbs as $db) { echo 'Génération models '.$db; $manager->setCurrentConnection($db); $generate = Doctrine::generateModelsFromDb($modelsPath.'/'.$db, array($db)); print_r($generate); echo "\n"; } ?>