From 8942564452a676b85ef1fe64da0eb239557ebf6d Mon Sep 17 00:00:00 2001 From: fujia Date: Wed, 10 Nov 2010 03:57:01 +0000 Subject: [PATCH] * load dao class auto. * fix the error when merge model files. --- framework/helper.class.php | 6 +++--- framework/router.class.php | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/framework/helper.class.php b/framework/helper.class.php index 76ba1c4730..054ed9b7e5 100644 --- a/framework/helper.class.php +++ b/framework/helper.class.php @@ -157,7 +157,7 @@ class helper if(empty($extFiles)) return $mainModelFile; /* Else, judge whether needed update or not .*/ - $mergedModelFile = $app->getTmpRoot() . 'model' . $app->getPathFix() . $app->site->code . '.' . $moduleName . '.php'; + $mergedModelFile = $app->getTmpRoot() . 'model' . $app->getPathFix() . $moduleName . '.php'; $needUpdate = false; $lastTime = file_exists($mergedModelFile) ? filemtime($mergedModelFile) : 0; foreach($extFiles as $extFile) @@ -186,8 +186,8 @@ class helper foreach($extFiles as $extFile) { $extLines = trim(file_get_contents($extFile)); - $extLines = ltrim($extLines, ''); + if(strpos($extLines, '') !== false) $extLines = rtrim($extLines, '?>'); $modelLines .= $extLines . "\n"; } diff --git a/framework/router.class.php b/framework/router.class.php index 8cd842311b..0e63892bf3 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -304,6 +304,7 @@ class router $this->loadClass('front', $static = true); $this->loadClass('filter', $static = true); + $this->loadClass('dao', $static = true); } /**