From 9fb0bcd1aa9cdd1b20c916a7c5154741c0ec513a Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 13 Feb 2007 04:33:05 +0000 Subject: Added support to include external application configuration files. --- framework/Web/THttpRequest.php | 33 ++++++++++----------------------- 1 file changed, 10 insertions(+), 23 deletions(-) (limited to 'framework/Web/THttpRequest.php') diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php index 47fe1230..9c3ce98d 100644 --- a/framework/Web/THttpRequest.php +++ b/framework/Web/THttpRequest.php @@ -568,22 +568,25 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar * A URL in the format of /index.php?sp=serviceID.serviceParameter * will be resolved with the serviceID and the serviceParameter. * You may override this method to provide your own way of service resolution. + * @param array list of valid service IDs + * @return string the currently requested service ID, null if no service ID is found * @see constructUrl */ - public function resolveRequest() + public function resolveRequest($serviceIDs) { Prado::trace("Resolving request from ".$_SERVER['REMOTE_ADDR'],'System.Web.THttpRequest'); - $this->_requestResolved=true; $this->_items=array_merge($_GET,$this->parseUrl(),$_POST); - foreach($this->_services as $id) + $this->_requestResolved=true; + foreach($serviceIDs as $serviceID) { - if($this->contains($id)) + if($this->contains($serviceID)) { - $this->setServiceID($id); - $this->setServiceParameter($this->itemAt($id)); - break; + $this->setServiceID($serviceID); + $this->setServiceParameter($this->itemAt($serviceID)); + return $serviceID; } } + return null; } /** @@ -594,22 +597,6 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar return $this->_requestResolved; } - /** - * @return array IDs of the available services - */ - public function getAvailableServices() - { - return $this->_services; - } - - /** - * @param array IDs of the available services - */ - public function setAvailableServices($services) - { - $this->_services=$services; - } - /** * @return string requested service ID */ -- cgit v1.2.3