From 82621f4f0a7e47314222fa3b21a0745425e1248b Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 14 May 2007 11:40:22 +0000 Subject: moving unfinished files to dev branch. --- .../Configuration/TProtectedConfiguration.php | 84 ---------------------- 1 file changed, 84 deletions(-) delete mode 100644 framework/Configuration/TProtectedConfiguration.php (limited to 'framework/Configuration/TProtectedConfiguration.php') diff --git a/framework/Configuration/TProtectedConfiguration.php b/framework/Configuration/TProtectedConfiguration.php deleted file mode 100644 index da643014..00000000 --- a/framework/Configuration/TProtectedConfiguration.php +++ /dev/null @@ -1,84 +0,0 @@ - - * @version $Id: TProtectedConfiguration.php 1398 2006-09-08 19:31:03Z xue $ - * @package System.Configuration - * @since 3.1 - */ -final class TProtectedConfiguration extends TModule -{ - private $_defaultProvider; - /** - * @var array list of providers available - */ - private $_providers=array(); - /** - * @var string external configuration file - */ - private $_configFile=null; - - public function getDefaultProvider() - { - return $this->_defaultProvider; - } - public function setDefaultProvider($value) - { - $this->_defaultProvider = TPropertyValue::ensureString($value); - } - public function getProvider($value=null) - { - if ($value) - $index = $value; - else - $index = $this->_defaultProvider; - - $provider = $this->_providers[$index]; - - if (!$provider instanceof TProviderBase) - throw new TConfigurationException('protectedconfiguration_not_a_provider',$index); - - return $provider; - } - - public function init($config) - { - if($this->_configFile!==null) - { - if(is_file($this->_configFile)) - { - $dom=new TXmlDocument; - $dom->loadFromFile($this->_configFile); - $this->loadConfig($dom); - } - else - throw new TConfigurationException('protectedconfiguration_configfile_invalid',$this->_configFile); - } - $this->loadConfig($config); -// $this->getApplication()->attachEventHandler('OnEndRequest',array($this,'collectLogs')); - } - /** - * Loads configuration from an XML element - * @param TXmlElement configuration node - * @throws TConfigurationException if log route class or type is not specified - */ - private function loadConfig($xml) - { - foreach($xml->getElementsByTagName('provider') as $providerConfig) - { - $properties=$providerConfig->getAttributes(); - if(($class=$properties->remove('class'))===null) - throw new TConfigurationException('protectedconfiguration_providerclass_required'); - $provider=Prado::createComponent($class); - if(!($provider instanceof TProviderBase)) - throw new TConfigurationException('protectedconfiguration_providertype_invalid'); - foreach($properties as $name=>$value) - $provider->setSubproperty($name,$value); - $this->_providers[$provider->getId()]=$provider; - $provider->init($providerConfig); - } - } -} -?> \ No newline at end of file -- cgit v1.2.3