Here's my bootstrap.php for my PHP/MySQL/Doctrine app.  It's my first PHP app so I'm interested in learning from the experience of others how this could be improved - security-wise, performance-wise, or otherwise.//-------------------------------------------------------------------------// Define global constantsdefine('ROOT_PATH', dirname(__FILE__) . '/');define('URL_BASE', 'http://localhost/myapp/public/');define('LIB_PATH', 'C:\\wamp\\www\\lib\\');define('OPENID_PATH', 'C:\\wamp\www\\lib\\lightopenid.git\\openid.php');//-------------------------------------------------------------------------// Bootstrap Doctrine.php, register autoloader, specify// configuration attributes and load models.require_once(LIB_PATH . 'doctrine12/lib/Doctrine.php');spl_autoload_register(array('Doctrine', 'autoload'));$manager = Doctrine_Manager::getInstance();//-------------------------------------------------------------------------// Define database connection$dsn = 'mysql:dbname=mydb;host=127.0.0.1';$user = 'xxx';$password = 'yyy';$dbh = new PDO($dsn, $user, $password);$conn = Doctrine_Manager::connection($dbh);//-------------------------------------------------------------------------// Set defaults$manager->setAttribute(Doctrine::ATTR_DEFAULT_COLUMN_OPTIONS,  array('type' => 'string', 'length' => 255, 'notnull' => true));$conn->setAttribute(Doctrine_Core::ATTR_QUOTE_IDENTIFIER, true);$manager->setAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, true);// Don't load a model until it's needed (causes problems when this is on)//$manager->setAttribute(Doctrine_Core::ATTR_MODEL_LOADING, Doctrine_Core::MODEL_LOADING_CONSERVATIVE);//-------------------------------------------------------------------------// Import model objectsDoctrine_Core::loadModels(ROOT_PATH . 'app/models/generated'); // have to load base classes firstDoctrine_Core::loadModels(ROOT_PATH . 'app/models');
PHP/Doctrine bootstrap for review
php;mysql;doctrine