From 24e264ac991898fd98e0b8e83e24a366bd399d85 Mon Sep 17 00:00:00 2001 From: jwage Date: Tue, 22 Jan 2008 22:08:08 +0000 Subject: [PATCH] Fixed compiler task and made Compiler return the path compiled file was written to. --- lib/Doctrine/Compiler.php | 4 +++- lib/Doctrine/Task/Compile.php | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/Compiler.php b/lib/Doctrine/Compiler.php index 9f02938a1..d3d95969a 100644 --- a/lib/Doctrine/Compiler.php +++ b/lib/Doctrine/Compiler.php @@ -39,7 +39,7 @@ class Doctrine_Compiler * cases dozens of files) can improve performance by an order of magnitude * * @throws Doctrine_Compiler_Exception if something went wrong during the compile operation - * @return void + * @return $target Path the compiled file was written to */ public static function compile($target = null, $includedDrivers = array()) { @@ -133,5 +133,7 @@ class Doctrine_Compiler fwrite($fp, $stripped); fclose($fp); + + return $target; } } diff --git a/lib/Doctrine/Task/Compile.php b/lib/Doctrine/Task/Compile.php index e6c3133a2..00d2147b5 100644 --- a/lib/Doctrine/Task/Compile.php +++ b/lib/Doctrine/Task/Compile.php @@ -39,8 +39,8 @@ class Doctrine_Task_Compile extends Doctrine_Task public function execute() { - Doctrine::compile($this->getArgument('compiled_path'), $this->getArgument('drivers', array())); - - $this->notify('Compiled Doctrine successfully to: ' . $this->getArgument('compiled_path')); + $compiledPath = Doctrine_Compiler::compile($this->getArgument('compiled_path'), $this->getArgument('drivers', array())); + + $this->notify('Compiled Doctrine successfully to: ' . $compiledPath); } } \ No newline at end of file