summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorxue <>2007-03-06 14:03:42 +0000
committerxue <>2007-03-06 14:03:42 +0000
commit13bbe877ff40d62431f78da6daad4615a92698ec (patch)
tree1be0db3f72ca50c322e2c66455df25c7b1abc446 /framework
parent8746007d968660f93dac079477405ded6fa14cbe (diff)
Better page class error reporting.
Diffstat (limited to 'framework')
-rw-r--r--framework/Exceptions/messages.txt1
-rw-r--r--framework/Web/Services/TPageService.php5
2 files changed, 5 insertions, 1 deletions
diff --git a/framework/Exceptions/messages.txt b/framework/Exceptions/messages.txt
index 79fdb8d1..164b81d3 100644
--- a/framework/Exceptions/messages.txt
+++ b/framework/Exceptions/messages.txt
@@ -103,6 +103,7 @@ pageservice_basepath_invalid = TPageService.BasePath '{0}' is not a valid dire
pageservice_page_required = Page Name Required
pageservice_defaultpage_unchangeable = TPageService.DefaultPage cannot be modified after the service is initialized.
pageservice_basepath_unchangeable = TPageService.BasePath cannot be modified after the service is initialized.
+pageservice_pageclass_invalid = Page class {0} is invalid. It should be TPage or extend from TPage.
pageserviceconf_file_invalid = Unable to open page directory configuration file '{0}'.
pageserviceconf_aliaspath_invalid = <alias id="{0}"> uses an invalid file path "{1}" in page directory configuration file '{2}'.
diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php
index e1bd47be..aed9d3e0 100644
--- a/framework/Web/Services/TPageService.php
+++ b/framework/Web/Services/TPageService.php
@@ -409,12 +409,15 @@ class TPageService extends TService
$className=basename($path);
if(!class_exists($className,false))
include_once($path.Prado::CLASS_FILE_EXT);
- if(!class_exists($className,false) || !is_subclass_of($className,'TPage'))
+ if(!class_exists($className,false))
throw new TConfigurationException('pageservice_pageclass_unknown',$className);
}
else
$className=$this->getBasePageClass();
+ if($className!=='TPage' && !is_subclass_of($className,'TPage'))
+ throw new TConfigurationException('pageservice_pageclass_invalid',$className);
+
$page=Prado::createComponent($className);
$page->setPagePath($pagePath);