From b65215830d710cf3c073120ae6f6a902670cc854 Mon Sep 17 00:00:00 2001 From: doctrine Date: Mon, 7 Aug 2006 22:03:55 +0000 Subject: [PATCH] Doctrine::compile fix --- Doctrine.php | 11 +++++++---- Doctrine/DB.php | 28 ---------------------------- manual/documentation.php | 1 + 3 files changed, 8 insertions(+), 32 deletions(-) diff --git a/Doctrine.php b/Doctrine.php index 0b1339399..c1bdcc59a 100644 --- a/Doctrine.php +++ b/Doctrine.php @@ -301,8 +301,10 @@ final class Doctrine { } } /** - * method for making a single file of - * most used doctrine components + * method for making a single file of most used doctrine components + * + * including the compiled file instead of multiple files (in worst + * cases dozens of files) can improve performance by order of magnitude * * @throws Doctrine_Exception * @return void @@ -339,13 +341,14 @@ final class Doctrine { "ForeignKey", "LocalKey", "Association", - "DB"); + "DB", + "DBStatement"); $ret = array(); foreach($classes as $class) { - if($class !== "Doctrine") + if($class !== 'Doctrine') $class = 'Doctrine_'.$class; $file = self::$path.DIRECTORY_SEPARATOR.str_replace("_",DIRECTORY_SEPARATOR,$class).".php"; diff --git a/Doctrine/DB.php b/Doctrine/DB.php index ad4d27f56..158610c6e 100644 --- a/Doctrine/DB.php +++ b/Doctrine/DB.php @@ -134,32 +134,4 @@ class Doctrine_DB extends PDO implements Countable, IteratorAggregate { } } -class Doctrine_DBStatement extends PDOStatement { - /** - * @param Doctrine_DB $dbh Doctrine Database Handler - */ - private $dbh; - /** - * @param Doctrine_DB $dbh - */ - private function __construct(Doctrine_DB $dbh) { - $this->dbh = $dbh; - } - /** - * @param array $params - */ - public function execute(array $params = array()) { - - $time = microtime(); - try { - $result = parent::execute($params); - } catch(PDOException $e) { - throw new Doctrine_Exception($this->queryString." ".$e->__toString()); - } - $exectime = (microtime() - $time); - $this->dbh->addExecTime($exectime); - - return $result; - } -} ?> diff --git a/manual/documentation.php b/manual/documentation.php index 930f57e01..745e9ead4 100644 --- a/manual/documentation.php +++ b/manual/documentation.php @@ -83,6 +83,7 @@ $menu = array("Getting started" => array( "Requirements", "Installation", + "Compiling", "Starting new project", "Setting table definition" => array( "Introduction",