From eb0eb44dbd2dbce7f34033a5bdbe78349f17a3b5 Mon Sep 17 00:00:00 2001 From: doctrine Date: Mon, 7 Aug 2006 22:40:06 +0000 Subject: [PATCH] Compiler issues fixed --- Doctrine.php | 2 ++ Doctrine/DataDict.php | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Doctrine.php b/Doctrine.php index c1bdcc59a..15d88364d 100644 --- a/Doctrine.php +++ b/Doctrine.php @@ -395,6 +395,8 @@ final class Doctrine { if(! self::$path) self::$path = dirname(__FILE__); + if(class_exists($classname)) + return false; $class = self::$path.DIRECTORY_SEPARATOR.str_replace("_",DIRECTORY_SEPARATOR,$classname).".php"; diff --git a/Doctrine/DataDict.php b/Doctrine/DataDict.php index 0ded6cf52..1165edfaf 100644 --- a/Doctrine/DataDict.php +++ b/Doctrine/DataDict.php @@ -4,8 +4,12 @@ class Doctrine_DataDict { private $dbh; public function __construct(PDO $dbh) { - $manager = Doctrine_Manager::getInstance(); - require_once($manager->getRoot()."/adodb-hack/adodb.inc.php"); + $file = Doctrine::getPath().DIRECTORY_SEPARATOR."Doctrine".DIRECTORY_SEPARATOR."adodb-hack".DIRECTORY_SEPARATOR."adodb.inc.php"; + + if( ! file_exists($file)) + throw new Doctrine_Exception("Couldn't include datadict. File $file does not exist"); + + require_once($file); $this->dbh = $dbh; $this->dict = NewDataDictionary($dbh); @@ -37,7 +41,7 @@ class Doctrine_DataDict { $return = true; foreach($a as $sql) { - try { + try { $this->dbh->query($sql); } catch(Exception $e) { $return = $e;