From 6b647694bdae2ab37246447cb965a5e7f97290ed Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 18 Nov 2005 18:52:28 +0000 Subject: --- framework/Web/Services/TPageService.php | 6 +++--- framework/Web/THttpResponse.php | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'framework/Web') diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php index 0ed4c67f..df239088 100644 --- a/framework/Web/Services/TPageService.php +++ b/framework/Web/Services/TPageService.php @@ -97,7 +97,7 @@ class TPageService extends TComponent implements IService if(empty($this->_pagePath)) $this->_pagePath=$this->_defaultPage; if(empty($this->_pagePath)) - throw new THttpException('pageservice_page_required'); + throw new THttpException(400,'pageservice_page_required'); if(($cache=$application->getCache())===null) { @@ -328,7 +328,7 @@ class TPageService extends TComponent implements IService if(class_exists($className,false)) $page=new $className($this->_properties); else - throw new THttpException('pageservice_page_unknown',$this->_pageType); + throw new THttpException(404,'pageservice_page_unknown',$this->_pageType); $writer=new THtmlTextWriter($this->_application->getResponse()); $page->run($writer); $writer->flush(); @@ -653,7 +653,7 @@ class TPageConfiguration extends TComponent } } if($page!==null && $this->_pageType===null) - throw new THttpException('pageservice_page_inexistent',$page); + throw new THttpException(404,'pageservice_page_unknown',$page); } } diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index 7f70de63..94f02b7c 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -34,6 +34,23 @@ */ class THttpResponse extends TComponent implements IModule, ITextWriter { + const STATUS_CONTINUE=100; + const STATUS_SWITCHINGPROTOCOLS=101; + const STATUS_OK=200; + const STATUS_CREATED=201; + const STATUS_ACCEPTED=202; + const STATUS_NONAUTHORITATIVEINFORMATION=203; + const STATUS_NOCONTENT=204; + const STATUS_RESETCONTENT=205; + const STATUS_PARTIALCONTENT=206; + const STATUS_MULTIPLE_CHOICES=300; + const STATUS_MOVEDPERMANENTLY=301; + const STATUS_FOUND=302; + const STATUS_SEEOTHER=303; + const STATUS_NOTMODIFIED=304; + const STATUS_USEPROXY=305; + const STATUS_TEMPORARYREDIRECT=306; + const STATUS_BADREQUEST=400; /** * @var string id of this module (response) */ -- cgit v1.2.3