From 82c13ca1da1a55748612f1caf8e8c05dae2643f4 Mon Sep 17 00:00:00 2001 From: zYne Date: Sun, 27 Aug 2006 19:39:05 +0000 Subject: [PATCH] Doctrine::compile() refactored --- Doctrine.php | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/Doctrine.php b/Doctrine.php index 8ba6ec4c1..cd3fc671e 100644 --- a/Doctrine.php +++ b/Doctrine.php @@ -368,24 +368,14 @@ final class Doctrine { throw new Doctrine_Exception("Couldn't compile $file. File $file does not exists."); self::autoload($class); - $refl = new ReflectionClass($class); - $lines = file($file); + $refl = new ReflectionClass ( $class ); + $lines = file( $file ); - $start = $refl->getStartLine() - 1; - $end = $refl->getEndLine() - 2; + $ret = array_merge($ret, + array_slice($lines, + $refl -> getStartLine() - 1, + $refl -> getEndLine() - 2)); - $i = 0; - while($i < count($lines)) { - $i++; - - if($i < $start) - continue; - - $ret[] = $lines[$i]; - - if($i > $end) - break; - } }