Commit 9046569d authored by zYne's avatar zYne

Doctrine::compile fixed

parent c5e4f366
...@@ -405,6 +405,7 @@ final class Doctrine { ...@@ -405,6 +405,7 @@ final class Doctrine {
"Iterator", "Iterator",
"Exception", "Exception",
"Access", "Access",
"Null",
"Record", "Record",
"Record_Iterator", "Record_Iterator",
"Collection", "Collection",
...@@ -444,21 +445,31 @@ final class Doctrine { ...@@ -444,21 +445,31 @@ final class Doctrine {
$refl = new ReflectionClass ( $class ); $refl = new ReflectionClass ( $class );
$lines = file( $file ); $lines = file( $file );
$start = $refl -> getStartLine() - 1;
$end = $refl -> getEndLine();
$ret = array_merge($ret, $ret = array_merge($ret,
array_slice($lines, array_slice($lines,
$refl -> getStartLine() - 1, $start,
$refl -> getEndLine() - 2)); ($end - $start)));
print $refl->getEndLine()."<br \>";
} }
$file = self::$path.DIRECTORY_SEPARATOR.'Doctrine.compiled.php';
$fp = fopen(self::$path.DIRECTORY_SEPARATOR.'Doctrine.compiled.php', 'w+'); $fp = fopen($file, 'w+');
fwrite($fp, "<?php fwrite($fp, "<?php
".implode('', $ret)." ".implode('', $ret)."
class InvalidKeyException extends Exception { } class InvalidKeyException extends Exception { }
class DQLException extends Exception { } class DQLException extends Exception { }
?>"); ?>");
fclose($fp); fclose($fp);
$stripped = php_strip_whitespace( $file );
//print $stripped;
$fp = fopen($file, 'w+');
fwrite($fp, $stripped);
fclose($fp);
} }
/** /**
* simple autoload function * simple autoload function
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment