From 21aa1d7bbcc46d3f76d3d60dd84b5def6905f783 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Tue, 29 May 2012 09:52:51 +0000 Subject: fix #406; additionally removed some safe_mode related code since it's deprecated --- framework/TApplication.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'framework/TApplication.php') diff --git a/framework/TApplication.php b/framework/TApplication.php index 65bb19da..c147fbd6 100644 --- a/framework/TApplication.php +++ b/framework/TApplication.php @@ -349,10 +349,9 @@ class TApplication extends TComponent // determine configuration path and file if(empty($basePath) || ($basePath=realpath($basePath))===false) throw new TConfigurationException('application_basepath_invalid',$basePath); - // is_file prints a warning if the file doesn't exists and open_basedir is in effect - if(@is_file($basePath.DIRECTORY_SEPARATOR.$this->getConfigurationFileName())) + if(is_file($basePath.DIRECTORY_SEPARATOR.$this->getConfigurationFileName())) $configFile=$basePath.DIRECTORY_SEPARATOR.$this->getConfigurationFileName(); - else if(@is_file($basePath)) + else if(is_file($basePath)) { $configFile=$basePath; $basePath=dirname($configFile); @@ -934,6 +933,11 @@ class TApplication extends TComponent return $this->_authRules; } + protected function getApplicationConfigurationClass() + { + return 'TApplicationConfiguration'; + } + /** * Applies an application configuration. * @param TApplicationConfiguration the configuration @@ -1007,7 +1011,8 @@ class TApplication extends TComponent { if(($path=Prado::getPathOfNamespace($filePath,$this->getConfigurationFileExt()))===null || !is_file($path)) throw new TConfigurationException('application_includefile_invalid',$filePath); - $c=new TApplicationConfiguration; + $cn=$this->getApplicationConfigurationClass(); + $c=new $cn; $c->loadFromFile($path); $this->applyConfiguration($c,$withinService); } -- cgit v1.2.3