Changeset 1743

Show
Ignore:
Timestamp:
03/06/2007 08:03:42 AM (21 months ago)
Author:
xue
Message:

Better page class error reporting.

Location:
trunk/framework
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/framework/Exceptions/messages.txt

    r1732 r1743  
    104104pageservice_defaultpage_unchangeable    = TPageService.DefaultPage cannot be modified after the service is initialized. 
    105105pageservice_basepath_unchangeable               = TPageService.BasePath cannot be modified after the service is initialized. 
     106pageservice_pageclass_invalid                   = Page class {0} is invalid. It should be TPage or extend from TPage. 
    106107 
    107108pageserviceconf_file_invalid                    = Unable to open page directory configuration file '{0}'. 
  • trunk/framework/Web/Services/TPageService.php

    r1742 r1743  
    410410                        if(!class_exists($className,false)) 
    411411                                include_once($path.Prado::CLASS_FILE_EXT); 
    412                         if(!class_exists($className,false) || !is_subclass_of($className,'TPage')) 
     412                        if(!class_exists($className,false)) 
    413413                                throw new TConfigurationException('pageservice_pageclass_unknown',$className); 
    414414                } 
    415415                else 
    416416                        $className=$this->getBasePageClass(); 
     417 
     418                if($className!=='TPage' && !is_subclass_of($className,'TPage')) 
     419                        throw new TConfigurationException('pageservice_pageclass_invalid',$className); 
    417420 
    418421                $page=Prado::createComponent($className);