summaryrefslogtreecommitdiff
path: root/framework/Web/Services
diff options
context:
space:
mode:
authorxue <>2007-03-12 19:41:17 +0000
committerxue <>2007-03-12 19:41:17 +0000
commit29101438588ca4b3a1d56f1fe7b0749d648b3a9b (patch)
treea02831d4f94d7cee68b32c6894869cfc287837ad /framework/Web/Services
parent1d2af84bffb5703a9bbd6bc5b07f983f22f3c369 (diff)
Fixed #562.
Diffstat (limited to 'framework/Web/Services')
-rw-r--r--framework/Web/Services/TPageService.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php
index aed9d3e0..58b7d57b 100644
--- a/framework/Web/Services/TPageService.php
+++ b/framework/Web/Services/TPageService.php
@@ -409,16 +409,19 @@ class TPageService extends TService
$className=basename($path);
if(!class_exists($className,false))
include_once($path.Prado::CLASS_FILE_EXT);
- if(!class_exists($className,false))
- throw new TConfigurationException('pageservice_pageclass_unknown',$className);
}
else
+ {
$className=$this->getBasePageClass();
+ Prado::using($className);
+ if(($pos=strrpos($className,'.'))!==false)
+ $className=substr($className,$pos+1);
+ }
- if($className!=='TPage' && !is_subclass_of($className,'TPage'))
- throw new TConfigurationException('pageservice_pageclass_invalid',$className);
+ if(!class_exists($className,false) || ($className!=='TPage' && !is_subclass_of($className,'TPage')))
+ throw new THttpException(404,'pageservice_page_unknown',$pagePath);
- $page=Prado::createComponent($className);
+ $page=new $className;
$page->setPagePath($pagePath);
if($hasTemplateFile)