Doctrine::compile fix
This commit is contained in:
parent
536f011764
commit
b65215830d
11
Doctrine.php
11
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";
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -83,6 +83,7 @@ $menu = array("Getting started" =>
|
||||
array(
|
||||
"Requirements",
|
||||
"Installation",
|
||||
"Compiling",
|
||||
"Starting new project",
|
||||
"Setting table definition" => array(
|
||||
"Introduction",
|
||||
|
Loading…
x
Reference in New Issue
Block a user