Changeset 845
- Timestamp:
- 03/27/08 10:24:42 (8 months ago)
- Files:
-
- trunk/lib/jelix/core/jConfigCompiler.class.php (modified) (3 diffs)
- trunk/lib/jelix/core/jConfigCompiler.class.php (modified) (3 diffs)
- trunk/lib/jelix/core/jConfigCompiler.class.php (modified) (3 diffs)
- trunk/lib/jelix/core/jCoordinator.class.php (modified) (1 diff)
- trunk/lib/jelix/core/jCoordinator.class.php (modified) (1 diff)
- trunk/lib/jelix/core/jCoordinator.class.php (modified) (1 diff)
- trunk/lib/jelix/core/jRequest.class.php (modified) (3 diffs)
- trunk/lib/jelix/core/jRequest.class.php (modified) (3 diffs)
- trunk/lib/jelix/core/jRequest.class.php (modified) (3 diffs)
- trunk/testapp/var/config/index/config.ini.php (modified) (1 diff)
- trunk/testapp/var/config/index/config.ini.php (modified) (1 diff)
- trunk/testapp/var/config/index/config.ini.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix/core/jConfigCompiler.class.php
r824 r845 72 72 $config->urlengine['jelixWWWPath'] = $path.$config->urlengine['jelixWWWPath']; 73 73 74 self::_initResponsesPath($config->responses); 75 self::_initResponsesPath($config->_coreResponses); 76 74 77 75 78 /*if(preg_match("/^([a-zA-Z]{2})(?:_([a-zA-Z]{2}))?$/",$config->locale,$m)){ … … 126 129 if($path!='' && $config['urlengine']['jelixWWWPath']{0} != '/') 127 130 $config['urlengine']['jelixWWWPath'] = $path.$config['urlengine']['jelixWWWPath']; 131 132 self::_initResponsesPath($config['responses']); 133 self::_initResponsesPath($config['_coreResponses']); 128 134 129 135 /*if(preg_match("/^([a-zA-Z]{2})(?:_([a-zA-Z]{2}))?$/",$config['locale'],$m)){ … … 289 295 } 290 296 297 /** 298 * get all physical pathes of responses file 299 */ 300 static private function _initResponsesPath(&$list){ 301 $copylist = $list; // because we modify $list and then it will search for "foo.path" responses... 302 foreach($copylist as $type=>$class){ 303 if(file_exists($path=JELIX_LIB_CORE_PATH.'response/'.$class.'.class.php')){ 304 $list[$type.'.path']=$path; 305 }elseif(file_exists($path=JELIX_APP_PATH.'responses/'.$class.'.class.php')){ 306 $list[$type.'.path']=$path; 307 }else{ 308 throw new Exception('Jelix Config Error: the class file of the response type "'.$type.'" is not found ('.$path.')'); 309 } 310 } 311 } 291 312 292 313 #ifnot ENABLE_PHP_JELIX trunk/lib/jelix/core/jConfigCompiler.class.php
r824 r845 72 72 $config->urlengine['jelixWWWPath'] = $path.$config->urlengine['jelixWWWPath']; 73 73 74 self::_initResponsesPath($config->responses); 75 self::_initResponsesPath($config->_coreResponses); 76 74 77 75 78 /*if(preg_match("/^([a-zA-Z]{2})(?:_([a-zA-Z]{2}))?$/",$config->locale,$m)){ … … 126 129 if($path!='' && $config['urlengine']['jelixWWWPath']{0} != '/') 127 130 $config['urlengine']['jelixWWWPath'] = $path.$config['urlengine']['jelixWWWPath']; 131 132 self::_initResponsesPath($config['responses']); 133 self::_initResponsesPath($config['_coreResponses']); 128 134 129 135 /*if(preg_match("/^([a-zA-Z]{2})(?:_([a-zA-Z]{2}))?$/",$config['locale'],$m)){ … … 289 295 } 290 296 297 /** 298 * get all physical pathes of responses file 299 */ 300 static private function _initResponsesPath(&$list){ 301 $copylist = $list; // because we modify $list and then it will search for "foo.path" responses... 302 foreach($copylist as $type=>$class){ 303 if(file_exists($path=JELIX_LIB_CORE_PATH.'response/'.$class.'.class.php')){ 304 $list[$type.'.path']=$path; 305 }elseif(file_exists($path=JELIX_APP_PATH.'responses/'.$class.'.class.php')){ 306 $list[$type.'.path']=$path; 307 }else{ 308 throw new Exception('Jelix Config Error: the class file of the response type "'.$type.'" is not found ('.$path.')'); 309 } 310 } 311 } 291 312 292 313 #ifnot ENABLE_PHP_JELIX trunk/lib/jelix/core/jConfigCompiler.class.php
r824 r845 72 72 $config->urlengine['jelixWWWPath'] = $path.$config->urlengine['jelixWWWPath']; 73 73 74 self::_initResponsesPath($config->responses); 75 self::_initResponsesPath($config->_coreResponses); 76 74 77 75 78 /*if(preg_match("/^([a-zA-Z]{2})(?:_([a-zA-Z]{2}))?$/",$config->locale,$m)){ … … 126 129 if($path!='' && $config['urlengine']['jelixWWWPath']{0} != '/') 127 130 $config['urlengine']['jelixWWWPath'] = $path.$config['urlengine']['jelixWWWPath']; 131 132 self::_initResponsesPath($config['responses']); 133 self::_initResponsesPath($config['_coreResponses']); 128 134 129 135 /*if(preg_match("/^([a-zA-Z]{2})(?:_([a-zA-Z]{2}))?$/",$config['locale'],$m)){ … … 289 295 } 290 296 297 /** 298 * get all physical pathes of responses file 299 */ 300 static private function _initResponsesPath(&$list){ 301 $copylist = $list; // because we modify $list and then it will search for "foo.path" responses... 302 foreach($copylist as $type=>$class){ 303 if(file_exists($path=JELIX_LIB_CORE_PATH.'response/'.$class.'.class.php')){ 304 $list[$type.'.path']=$path; 305 }elseif(file_exists($path=JELIX_APP_PATH.'responses/'.$class.'.class.php')){ 306 $list[$type.'.path']=$path; 307 }else{ 308 throw new Exception('Jelix Config Error: the class file of the response type "'.$type.'" is not found ('.$path.')'); 309 } 310 } 311 } 291 312 292 313 #ifnot ENABLE_PHP_JELIX trunk/lib/jelix/core/jCoordinator.class.php
r838 r845 264 264 265 265 $respclass = $gJConfig->responses[$type]; 266 if(file_exists($path=JELIX_LIB_CORE_PATH.'response/'.$respclass.'.class.php')){ 267 require_once ($path); 268 }elseif(file_exists($path=JELIX_APP_PATH.'responses/'.$respclass.'.class.php')){ 269 require_once ($path); 270 }else{ 271 return jLocale::get('jelix~errors.default.response.not.loaded',array($this->moduleName.'~'.$this->actionName,$type)); 272 } 266 require_once ($gJConfig->responses[$type.'.path']); 273 267 274 268 $this->response = new $respclass(); trunk/lib/jelix/core/jCoordinator.class.php
r838 r845 264 264 265 265 $respclass = $gJConfig->responses[$type]; 266 if(file_exists($path=JELIX_LIB_CORE_PATH.'response/'.$respclass.'.class.php')){ 267 require_once ($path); 268 }elseif(file_exists($path=JELIX_APP_PATH.'responses/'.$respclass.'.class.php')){ 269 require_once ($path); 270 }else{ 271 return jLocale::get('jelix~errors.default.response.not.loaded',array($this->moduleName.'~'.$this->actionName,$type)); 272 } 266 require_once ($gJConfig->responses[$type.'.path']); 273 267 274 268 $this->response = new $respclass(); trunk/lib/jelix/core/jCoordinator.class.php
r838 r845 264 264 265 265 $respclass = $gJConfig->responses[$type]; 266 if(file_exists($path=JELIX_LIB_CORE_PATH.'response/'.$respclass.'.class.php')){ 267 require_once ($path); 268 }elseif(file_exists($path=JELIX_APP_PATH.'responses/'.$respclass.'.class.php')){ 269 require_once ($path); 270 }else{ 271 return jLocale::get('jelix~errors.default.response.not.loaded',array($this->moduleName.'~'.$this->actionName,$type)); 272 } 266 require_once ($gJConfig->responses[$type.'.path']); 273 267 274 268 $this->response = new $respclass(); trunk/lib/jelix/core/jRequest.class.php
r839 r845 208 208 } 209 209 $respclass = $gJConfig->_coreResponses[$type]; 210 $path = $gJConfig->_coreResponses[$type.'.path']; 210 211 }else{ 211 212 if(!isset($gJConfig->responses[$type])){ … … 213 214 } 214 215 $respclass = $gJConfig->responses[$type]; 215 } 216 if(file_exists($path=JELIX_LIB_CORE_PATH.'response/'.$respclass.'.class.php')){ 217 require_once ($path); 218 }elseif(file_exists($path=JELIX_APP_PATH.'responses/'.$respclass.'.class.php')){ 219 require_once ($path); 220 }else{ 221 throw new jException('jelix~errors.ad.response.not.loaded',array($gJCoord->action->resource,$type,$gJCoord->action->getPath())); 216 $path = $gJConfig->responses[$type.'.path']; 222 217 } 223 218 … … 226 221 } 227 222 223 require_once ($path); 224 228 225 $response = new $respclass(); 229 226 $gJCoord->response= $response; trunk/lib/jelix/core/jRequest.class.php
r839 r845 208 208 } 209 209 $respclass = $gJConfig->_coreResponses[$type]; 210 $path = $gJConfig->_coreResponses[$type.'.path']; 210 211 }else{ 211 212 if(!isset($gJConfig->responses[$type])){ … … 213 214 } 214 215 $respclass = $gJConfig->responses[$type]; 215 } 216 if(file_exists($path=JELIX_LIB_CORE_PATH.'response/'.$respclass.'.class.php')){ 217 require_once ($path); 218 }elseif(file_exists($path=JELIX_APP_PATH.'responses/'.$respclass.'.class.php')){ 219 require_once ($path); 220 }else{ 221 throw new jException('jelix~errors.ad.response.not.loaded',array($gJCoord->action->resource,$type,$gJCoord->action->getPath())); 216 $path = $gJConfig->responses[$type.'.path']; 222 217 } 223 218 … … 226 221 } 227 222 223 require_once ($path); 224 228 225 $response = new $respclass(); 229 226 $gJCoord->response= $response; trunk/lib/jelix/core/jRequest.class.php
r839 r845 208 208 } 209 209 $respclass = $gJConfig->_coreResponses[$type]; 210 $path = $gJConfig->_coreResponses[$type.'.path']; 210 211 }else{ 211 212 if(!isset($gJConfig->responses[$type])){ … … 213 214 } 214 215 $respclass = $gJConfig->responses[$type]; 215 } 216 if(file_exists($path=JELIX_LIB_CORE_PATH.'response/'.$respclass.'.class.php')){ 217 require_once ($path); 218 }elseif(file_exists($path=JELIX_APP_PATH.'responses/'.$respclass.'.class.php')){ 219 require_once ($path); 220 }else{ 221 throw new jException('jelix~errors.ad.response.not.loaded',array($gJCoord->action->resource,$type,$gJCoord->action->getPath())); 216 $path = $gJConfig->responses[$type.'.path']; 222 217 } 223 218 … … 226 221 } 227 222 223 require_once ($path); 224 228 225 $response = new $respclass(); 229 226 $gJCoord->response= $response; trunk/testapp/var/config/index/config.ini.php
r691 r845 7 7 [responses] 8 8 html = myHtmlResponse 9 unittest = testUnitResponse10 9 trunk/testapp/var/config/index/config.ini.php
r691 r845 7 7 [responses] 8 8 html = myHtmlResponse 9 unittest = testUnitResponse10 9 trunk/testapp/var/config/index/config.ini.php
r691 r845 7 7 [responses] 8 8 html = myHtmlResponse 9 unittest = testUnitResponse10 9
