Skip to content

Instantly share code, notes, and snippets.

@maxparm
Created February 3, 2011 00:07
Show Gist options
  • Save maxparm/808792 to your computer and use it in GitHub Desktop.
Save maxparm/808792 to your computer and use it in GitHub Desktop.
Bootstrap file
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
public function _initDoctrine()
{
$config = $this->getResource('config');
$config = $config['doctrine'];
require_once('Doctrine.compiled.php');
spl_autoload_register(array('Doctrine', 'modelsAutoload'));
$manager = Doctrine_Manager::getInstance();
$manager->setAttribute(Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATIVE);
$manager->setAttribute(Doctrine_Core::ATTR_AUTO_ACCESSOR_OVERRIDE, true);
$manager->setAttribute(Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_ALL);
Doctrine::loadModels($config['models_path']);
$manager->openConnection($config['connection_string']);
return $manager;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment