Created
February 3, 2011 00:07
-
-
Save maxparm/808792 to your computer and use it in GitHub Desktop.
Bootstrap file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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