Changeset 716
- Timestamp:
- 12/30/07 18:28:50 (1 year ago)
- Files:
-
- trunk/build/manifests/testapp.mn (modified) (1 diff)
- trunk/build/manifests/testapp.mn (modified) (1 diff)
- trunk/lib/jelix-scripts/templates/var/config/defaultconfig.ini.php.tpl (modified) (1 diff)
- trunk/lib/jelix-scripts/templates/var/config/defaultconfig.ini.php.tpl (modified) (1 diff)
- trunk/lib/jelix/core/defaultconfig.ini.php (modified) (2 diffs)
- trunk/lib/jelix/core/defaultconfig.ini.php (modified) (2 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/jRequest.class.php (modified) (2 diffs)
- trunk/lib/jelix/core/jRequest.class.php (modified) (2 diffs)
- trunk/lib/jelix/core/jUrl.class.php (modified) (1 diff)
- trunk/lib/jelix/core/jUrl.class.php (modified) (1 diff)
- trunk/lib/jelix/core/request/jClassicRequest.class.php (modified) (1 diff)
- trunk/lib/jelix/core/request/jClassicRequest.class.php (modified) (1 diff)
- trunk/lib/jelix/core/request/jCmdLineRequest.class.php (modified) (1 diff)
- trunk/lib/jelix/core/request/jCmdLineRequest.class.php (modified) (1 diff)
- trunk/lib/jelix/core/request/jCssRequest.class.php (modified) (1 diff)
- trunk/lib/jelix/core/request/jCssRequest.class.php (modified) (1 diff)
- trunk/lib/jelix/core/request/jRdfRequest.class.php (modified) (1 diff)
- trunk/lib/jelix/core/request/jRdfRequest.class.php (modified) (1 diff)
- trunk/lib/jelix/core/request/jXulRequest.class.php (modified) (1 diff)
- trunk/lib/jelix/core/request/jXulRequest.class.php (modified) (1 diff)
- trunk/lib/jelix/plugins/urls/simple/simple.urls.php (modified) (1 diff)
- trunk/lib/jelix/plugins/urls/simple/simple.urls.php (modified) (1 diff)
- trunk/myapp/var/config/defaultconfig.ini.php (modified) (2 diffs)
- trunk/myapp/var/config/defaultconfig.ini.php (modified) (2 diffs)
- trunk/testapp/INSTALL.txt (modified) (1 diff)
- trunk/testapp/INSTALL.txt (modified) (1 diff)
- trunk/testapp/modules/jelix_tests/tests/core.jrequest.html_cli.php (added)
- trunk/testapp/modules/jelix_tests/tests/core.jrequest.html_cli.php (added)
- trunk/testapp/modules/jelix_tests/tests/core.old_urls_generation.html.php (modified) (6 diffs)
- trunk/testapp/modules/jelix_tests/tests/core.old_urls_generation.html.php (modified) (6 diffs)
- trunk/testapp/modules/jelix_tests/tests/core.old_urls_parsing.html.php (modified) (3 diffs)
- trunk/testapp/modules/jelix_tests/tests/core.old_urls_parsing.html.php (modified) (3 diffs)
- trunk/testapp/modules/jelix_tests/tests/core.urls_generation.html.php (modified) (6 diffs)
- trunk/testapp/modules/jelix_tests/tests/core.urls_generation.html.php (modified) (6 diffs)
- trunk/testapp/modules/jelix_tests/tests/core.urls_parsing.html.php (modified) (3 diffs)
- trunk/testapp/modules/jelix_tests/tests/core.urls_parsing.html.php (modified) (3 diffs)
- trunk/testapp/var/config/defaultconfig.ini.php (modified) (2 diffs)
- trunk/testapp/var/config/defaultconfig.ini.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/build/manifests/testapp.mn
r708 r716 118 118 cd testapp/modules/jelix_tests/tests/ 119 119 core.jlocale.html.php 120 core.jrequest.html_cli.php 120 121 core.selectors_action.html.php 121 122 core.old_selectors_action.html.php trunk/build/manifests/testapp.mn
r708 r716 118 118 cd testapp/modules/jelix_tests/tests/ 119 119 core.jlocale.html.php 120 core.jrequest.html_cli.php 120 121 core.selectors_action.html.php 121 122 core.old_selectors_action.html.php trunk/lib/jelix-scripts/templates/var/config/defaultconfig.ini.php.tpl
r691 r716 78 78 ;notfoundAct = "jelix~error:notfound" 79 79 80 ;indique si vous utilisez IIS comme serveur 81 useIIS = off 82 83 ;indique le paramètre dans $_GET où est indiqué le path_info 84 IISPathKey = __JELIX_URL__ 85 86 ;indique si il faut stripslashé le path_info récupéré par le biais de IISPathKey 87 IISStripslashes_path_key = on 80 ; liste des actions requerant https (syntaxe expliquée dessous), pour le moteur d'url simple 81 simple_urlengine_https = 88 82 89 83 trunk/lib/jelix-scripts/templates/var/config/defaultconfig.ini.php.tpl
r691 r716 78 78 ;notfoundAct = "jelix~error:notfound" 79 79 80 ;indique si vous utilisez IIS comme serveur 81 useIIS = off 82 83 ;indique le paramètre dans $_GET où est indiqué le path_info 84 IISPathKey = __JELIX_URL__ 85 86 ;indique si il faut stripslashé le path_info récupéré par le biais de IISPathKey 87 IISStripslashes_path_key = on 80 ; liste des actions requerant https (syntaxe expliquée dessous), pour le moteur d'url simple 81 simple_urlengine_https = 88 82 89 83 trunk/lib/jelix/core/defaultconfig.ini.php
r696 r716 102 102 multiview = off 103 103 104 ; the name of the variable in $_SERVER which contains the name of the script 105 ; example : if the you call http://mysite.com/foo/index.php, this is the variable 106 ; which contains "/foo/index.php" 107 ; This name can be SCRIPT_NAME, ORIG_SCRIPT_NAME, PHP_SELF or REDIRECT_SCRIPT_URL 108 ; it is detected automatically by jelix but it can fail sometime, so you could have to setup it 109 scriptNameServerVariable = 110 111 104 112 ; basePath corresponds to the path to the base directory of your application. 105 113 ; so if the url to access to your application is http://foo.com/aaa/bbb/www/index.php, you should … … 125 133 notfoundAct = 126 134 ;notfoundAct = "jelix~error:notfound" 127 128 ;if you use IIS as a serveur set it to on129 useIIS = off130 131 ;if you use IIS, indicate the parameter which contains the path_info132 IISPathKey = __JELIX_URL__133 134 ;indique si il faut stripslashé le path_info récupéré par le biais de IISPathKey135 IISStripslashes_path_key = on136 135 137 136 ; liste des actions requerant https (syntaxe expliquée dessous), pour le moteur d'url simple trunk/lib/jelix/core/defaultconfig.ini.php
r696 r716 102 102 multiview = off 103 103 104 ; the name of the variable in $_SERVER which contains the name of the script 105 ; example : if the you call http://mysite.com/foo/index.php, this is the variable 106 ; which contains "/foo/index.php" 107 ; This name can be SCRIPT_NAME, ORIG_SCRIPT_NAME, PHP_SELF or REDIRECT_SCRIPT_URL 108 ; it is detected automatically by jelix but it can fail sometime, so you could have to setup it 109 scriptNameServerVariable = 110 111 104 112 ; basePath corresponds to the path to the base directory of your application. 105 113 ; so if the url to access to your application is http://foo.com/aaa/bbb/www/index.php, you should … … 125 133 notfoundAct = 126 134 ;notfoundAct = "jelix~error:notfound" 127 128 ;if you use IIS as a serveur set it to on129 useIIS = off130 131 ;if you use IIS, indicate the parameter which contains the path_info132 IISPathKey = __JELIX_URL__133 134 ;indique si il faut stripslashé le path_info récupéré par le biais de IISPathKey135 IISStripslashes_path_key = on136 135 137 136 ; liste des actions requerant https (syntaxe expliquée dessous), pour le moteur d'url simple trunk/lib/jelix/core/jConfigCompiler.class.php
r699 r716 57 57 $config->_trustedModules = array_keys($config->_modulesPathList); 58 58 } 59 60 if($config->urlengine['scriptNameServerVariable'] == '') { 61 $config->urlengine['scriptNameServerVariable'] = self::_findServerName($config->urlengine['entrypointExtension']); 62 } 63 59 64 $path=$config->urlengine['basePath']; 60 65 if($path!='/' && $path!=''){ … … 107 112 $config['_trustedModules'] = array_keys($config['_modulesPathList']); 108 113 } 114 115 if($config['urlengine']['scriptNameServerVariable'] == '') { 116 $config['urlengine']['scriptNameServerVariable'] = self::_findServerName($config['urlengine']['entrypointExtension']); 117 } 118 109 119 $path=$config['urlengine']['basePath']; 110 120 if($path!='/' && $path!=''){ … … 262 272 } 263 273 274 static private function _findServerName($ext) { 275 $varname = ''; 276 $extlen = strlen($ext); 277 278 if(strrpos($_SERVER['SCRIPT_NAME'], $ext) === (strlen($_SERVER['SCRIPT_NAME']) - $extlen)) { 279 return 'SCRIPT_NAME'; 280 }else if (isset($_SERVER['REDIRECT_URL']) && strrpos( $_SERVER['REDIRECT_URL'], $ext) === (strlen( $_SERVER['REDIRECT_URL']) -$extlen)) { 281 return 'REDIRECT_URL'; 282 }else if (isset($_SERVER['ORIG_SCRIPT_NAME']) && strrpos( $_SERVER['ORIG_SCRIPT_NAME'], $ext) === (strlen( $_SERVER['ORIG_SCRIPT_NAME']) - $extlen)) { 283 return 'ORIG_SCRIPT_NAME'; 284 } 285 throw new Exception('Jelix Error: in config file the parameter urlengine:scriptNameServerVariable is empty and Jelix don\'t find 286 the variable in $_SERVER which contains the script name. You must see phpinfo and setup this parameter in your config file.'); 287 } 288 289 264 290 #ifnot ENABLE_PHP_JELIX 265 291 /** trunk/lib/jelix/core/jConfigCompiler.class.php
r699 r716 57 57 $config->_trustedModules = array_keys($config->_modulesPathList); 58 58 } 59 60 if($config->urlengine['scriptNameServerVariable'] == '') { 61 $config->urlengine['scriptNameServerVariable'] = self::_findServerName($config->urlengine['entrypointExtension']); 62 } 63 59 64 $path=$config->urlengine['basePath']; 60 65 if($path!='/' && $path!=''){ … … 107 112 $config['_trustedModules'] = array_keys($config['_modulesPathList']); 108 113 } 114 115 if($config['urlengine']['scriptNameServerVariable'] == '') { 116 $config['urlengine']['scriptNameServerVariable'] = self::_findServerName($config['urlengine']['entrypointExtension']); 117 } 118 109 119 $path=$config['urlengine']['basePath']; 110 120 if($path!='/' && $path!=''){ … … 262 272 } 263 273 274 static private function _findServerName($ext) { 275 $varname = ''; 276 $extlen = strlen($ext); 277 278 if(strrpos($_SERVER['SCRIPT_NAME'], $ext) === (strlen($_SERVER['SCRIPT_NAME']) - $extlen)) { 279 return 'SCRIPT_NAME'; 280 }else if (isset($_SERVER['REDIRECT_URL']) && strrpos( $_SERVER['REDIRECT_URL'], $ext) === (strlen( $_SERVER['REDIRECT_URL']) -$extlen)) { 281 return 'REDIRECT_URL'; 282 }else if (isset($_SERVER['ORIG_SCRIPT_NAME']) && strrpos( $_SERVER['ORIG_SCRIPT_NAME'], $ext) === (strlen( $_SERVER['ORIG_SCRIPT_NAME']) - $extlen)) { 283 return 'ORIG_SCRIPT_NAME'; 284 } 285 throw new Exception('Jelix Error: in config file the parameter urlengine:scriptNameServerVariable is empty and Jelix don\'t find 286 the variable in $_SERVER which contains the script name. You must see phpinfo and setup this parameter in your config file.'); 287 } 288 289 264 290 #ifnot ENABLE_PHP_JELIX 265 291 /** trunk/lib/jelix/core/jRequest.class.php
r699 r716 40 40 41 41 /** 42 * the path of the entry point in the url 43 * if the url is /foo/index.php/bar, its value is /foo/ 44 * @var string 45 */ 46 public $urlScriptPath; 47 48 /** 49 * the name of the entry point 50 * if the url is /foo/index.php/bar, its value is index.php 51 * @var string 52 */ 53 public $urlScriptName; 54 55 /** 42 56 * the path to the entry point in the url 43 * @var string 57 * if the url is /foo/index.php/bar, its value is /foo/index.php 58 * @var string 59 */ 60 public $urlScript; 61 62 /** 63 * the pathinfo part of the url 64 * if the url is /foo/index.php/bar, its value is /bar 65 * @var string 66 */ 67 public $urlPathInfo; 68 69 70 /** 71 * @var string 72 * @deprecated see $urlScriptPath 44 73 */ 45 74 public $url_script_path; 46 75 47 76 /** 48 * the name of the entry point49 * @ var string77 * @var string 78 * @deprecated see $urlScriptName 50 79 */ 51 80 public $url_script_name; 52 81 53 82 /** 54 * the pathinfo part of the url55 * @ var string83 * @var string 84 * @deprecated see $urlPathInfo 56 85 */ 57 86 public $url_path_info; 87 88 58 89 59 90 function __construct(){ } … … 73 104 74 105 /** 75 * inits the url_* properties 76 * @copyright 2003-2005 CopixTeam 77 * method took from Copix Framework v2.3dev20050901, CopixCoordinator.class.php, 78 * released under GNU Lesser General Public Licence. 79 * @author Gerald Croes 80 * @contributor Laurent Jouanneau 106 * init the url* properties 81 107 */ 82 108 protected function _initUrlDatas(){ 83 109 global $gJConfig; 84 110 85 $lastslash = strrpos ($_SERVER['SCRIPT_NAME'], '/'); 86 $this->url_script_path = substr ($_SERVER['SCRIPT_NAME'], 0,$lastslash ).'/';//following is subdir/ 111 if (isset($_SERVER[$gJConfig->urlengine['scriptNameServerVariable']])) 112 $this->urlScript = $_SERVER[$gJConfig->urlengine['scriptNameServerVariable']]; 113 else 114 $this->urlScript = $_SERVER['SCRIPT_NAME']; 115 116 $lastslash = strrpos ($this->urlScript, '/'); 117 $this->url_script_path = $this->urlScriptPath = substr ($this->urlScript, 0, $lastslash ).'/'; 118 87 119 if($gJConfig->urlengine['basePath'] == ''){ // for beginners or simple site, we "guess" the base path 88 $gJConfig->urlengine['basePath'] = $this->url _script_path;120 $gJConfig->urlengine['basePath'] = $this->urlScriptPath; 89 121 if($gJConfig->urlengine['jelixWWWPath']{0} != '/') 90 $gJConfig->urlengine['jelixWWWPath'] = $this->url _script_path.$gJConfig->urlengine['jelixWWWPath'];91 }else if(strpos($this->url _script_path,$gJConfig->urlengine['basePath']) !== 0){92 die('Jelix Error: basePath in config file doesn\'t correspond to current base path. You should setup it to '.$this->url_script_path);93 } 94 95 $this->url_script_name = substr ($_SERVER['SCRIPT_NAME'], $lastslash+1);//following is index.php122 $gJConfig->urlengine['jelixWWWPath'] = $this->urlScriptPath.$gJConfig->urlengine['jelixWWWPath']; 123 }else if(strpos($this->urlScriptPath,$gJConfig->urlengine['basePath']) !== 0){ 124 throw new Exception('Jelix Error: basePath in config file doesn\'t correspond to current base path. You should setup it to '.$this->urlScriptPath); 125 } 126 127 $this->url_script_name = $this->urlScriptName = substr ($this->urlScript, $lastslash+1); 96 128 97 129 if(isset($_SERVER['PATH_INFO'])){ 98 130 $pathinfo = $_SERVER['PATH_INFO']; 99 if ($gJConfig->isWindows && strpos ($_SERVER['PATH_INFO'], $_SERVER['SCRIPT_NAME']) !== false){ 100 //under IIS, we may get as PATH_INFO /subdir/index.php/mypath/myaction (which is incorrect) 101 $pathinfo = substr ($_SERVER['PATH_INFO'], strlen ($_SERVER['SCRIPT_NAME'])); 102 } 103 }else{ 104 if($gJConfig->isWindows && $gJConfig->urlengine['useIIS'] && isset ($_GET[$gJConfig->urlengine['IISPathKey']])){ 105 $pathinfo = $_GET[$gJConfig->urlengine['IISPathKey']]; 106 $pathinfo = $gJConfig->urlengine['IISStripslashesPathKey'] === true ? stripslashes($pathinfo) : $pathinfo; 107 }else{ 108 //if($_SERVER['PHP_SELF']!= $_SERVER['SCRIPT_NAME']){ 109 // $pathinfo = substr($_SERVER['PHP_SELF'], strlen($_SERVER['SCRIPT_NAME'])-1); 110 //}else 111 $pathinfo=''; 112 113 } 114 } 115 $this->url_path_info = $pathinfo; 131 } else if(isset($_SERVER['ORIG_PATH_INFO'])){ 132 $pathinfo = $_SERVER['ORIG_PATH_INFO']; 133 } else 134 $pathinfo = ''; 135 136 if($pathinfo == $this->urlScript) { 137 //when php is used as cgi and if there isn't pathinfo in the url 138 $pathinfo = ''; 139 } 140 141 if ($gJConfig->isWindows && $pathinfo && strpos ($pathinfo, $this->urlScript) !== false){ 142 //under IIS, we may get /subdir/index.php/mypath/myaction as PATH_INFO, so we fix it 143 $pathinfo = substr ($pathinfo, strlen ($this->urlScript)); 144 } 145 146 $this->url_path_info = $this->urlPathInfo = $pathinfo; 116 147 } 117 148 trunk/lib/jelix/core/jRequest.class.php
r699 r716 40 40 41 41 /** 42 * the path of the entry point in the url 43 * if the url is /foo/index.php/bar, its value is /foo/ 44 * @var string 45 */ 46 public $urlScriptPath; 47 48 /** 49 * the name of the entry point 50 * if the url is /foo/index.php/bar, its value is index.php 51 * @var string 52 */ 53 public $urlScriptName; 54 55 /** 42 56 * the path to the entry point in the url 43 * @var string 57 * if the url is /foo/index.php/bar, its value is /foo/index.php 58 * @var string 59 */ 60 public $urlScript; 61 62 /** 63 * the pathinfo part of the url 64 * if the url is /foo/index.php/bar, its value is /bar 65 * @var string 66 */ 67 public $urlPathInfo; 68 69 70 /** 71 * @var string 72 * @deprecated see $urlScriptPath 44 73 */ 45 74 public $url_script_path; 46 75 47 76 /** 48 * the name of the entry point49 * @ var string77 * @var string 78 * @deprecated see $urlScriptName 50 79 */ 51 80 public $url_script_name; 52 81 53 82 /** 54 * the pathinfo part of the url55 * @ var string83 * @var string 84 * @deprecated see $urlPathInfo 56 85 */ 57 86 public $url_path_info; 87 88 58 89 59 90 function __construct(){ } … … 73 104 74 105 /** 75 * inits the url_* properties 76 * @copyright 2003-2005 CopixTeam 77 * method took from Copix Framework v2.3dev20050901, CopixCoordinator.class.php, 78 * released under GNU Lesser General Public Licence. 79 * @author Gerald Croes 80 * @contributor Laurent Jouanneau 106 * init the url* properties 81 107 */ 82 108 protected function _initUrlDatas(){ 83 109 global $gJConfig; 84 110 85 $lastslash = strrpos ($_SERVER['SCRIPT_NAME'], '/'); 86 $this->url_script_path = substr ($_SERVER['SCRIPT_NAME'], 0,$lastslash ).'/';//following is subdir/ 111 if (isset($_SERVER[$gJConfig->urlengine['scriptNameServerVariable']])) 112 $this->urlScript = $_SERVER[$gJConfig->urlengine['scriptNameServerVariable']]; 113 else 114 $this->urlScript = $_SERVER['SCRIPT_NAME']; 115 116 $lastslash = strrpos ($this->urlScript, '/'); 117 $this->url_script_path = $this->urlScriptPath = substr ($this->urlScript, 0, $lastslash ).'/'; 118 87 119 if($gJConfig->urlengine['basePath'] == ''){ // for beginners or simple site, we "guess" the base path 88 $gJConfig->urlengine['basePath'] = $this->url _script_path;120 $gJConfig->urlengine['basePath'] = $this->urlScriptPath; 89 121 if($gJConfig->urlengine['jelixWWWPath']{0} != '/') 90 $gJConfig->urlengine['jelixWWWPath'] = $this->url _script_path.$gJConfig->urlengine['jelixWWWPath'];91 }else if(strpos($this->url _script_path,$gJConfig->urlengine['basePath']) !== 0){92 die('Jelix Error: basePath in config file doesn\'t correspond to current base path. You should setup it to '.$this->url_script_path);93 } 94 95 $this->url_script_name = substr ($_SERVER['SCRIPT_NAME'], $lastslash+1);//following is index.php122 $gJConfig->urlengine['jelixWWWPath'] = $this->urlScriptPath.$gJConfig->urlengine['jelixWWWPath']; 123 }else if(strpos($this->urlScriptPath,$gJConfig->urlengine['basePath']) !== 0){ 124 throw new Exception('Jelix Error: basePath in config file doesn\'t correspond to current base path. You should setup it to '.$this->urlScriptPath); 125 } 126 127 $this->url_script_name = $this->urlScriptName = substr ($this->urlScript, $lastslash+1); 96 128 97 129 if(isset($_SERVER['PATH_INFO'])){ 98 130 $pathinfo = $_SERVER['PATH_INFO']; 99 if ($gJConfig->isWindows && strpos ($_SERVER['PATH_INFO'], $_SERVER['SCRIPT_NAME']) !== false){ 100 //under IIS, we may get as PATH_INFO /subdir/index.php/mypath/myaction (which is incorrect) 101 $pathinfo = substr ($_SERVER['PATH_INFO'], strlen ($_SERVER['SCRIPT_NAME'])); 102 } 103 }else{ 104 if($gJConfig->isWindows && $gJConfig->urlengine['useIIS'] && isset ($_GET[$gJConfig->urlengine['IISPathKey']])){ 105 $pathinfo = $_GET[$gJConfig->urlengine['IISPathKey']]; 106 $pathinfo = $gJConfig->urlengine['IISStripslashesPathKey'] === true ? stripslashes($pathinfo) : $pathinfo; 107 }else{ 108 //if($_SERVER['PHP_SELF']!= $_SERVER['SCRIPT_NAME']){ 109 // $pathinfo = substr($_SERVER['PHP_SELF'], strlen($_SERVER['SCRIPT_NAME'])-1); 110 //}else 111 $pathinfo=''; 112 113 } 114 } 115 $this->url_path_info = $pathinfo; 131 } else if(isset($_SERVER['ORIG_PATH_INFO'])){ 132 $pathinfo = $_SERVER['ORIG_PATH_INFO']; 133 } else 134 $pathinfo = ''; 135 136 if($pathinfo == $this->urlScript) { 137 //when php is used as cgi and if there isn't pathinfo in the url 138 $pathinfo = ''; 139 } 140 141 if ($gJConfig->isWindows && $pathinfo && strpos ($pathinfo, $this->urlScript) !== false){ 142 //under IIS, we may get /subdir/index.php/mypath/myaction as PATH_INFO, so we fix it 143 $pathinfo = substr ($pathinfo, strlen ($this->urlScript)); 144 } 145 146 $this->url_path_info = $this->urlPathInfo = $pathinfo; 116 147 } 117 148 trunk/lib/jelix/core/jUrl.class.php
r699 r716 229 229 static $url = false; 230 230 if ($url === false){ 231 $url = 'http://'.$_SERVER['HTTP_HOST'].$ _SERVER['SCRIPT_NAME'].$GLOBALS['gJCoord']->request->url_path_info.'?';231 $url = 'http://'.$_SERVER['HTTP_HOST'].$GLOBALS['gJCoord']->request->urlScript.$GLOBALS['gJCoord']->request->urlPathInfo.'?'; 232 232 $q = http_build_query($_GET, '', ($forxml?'&':'&')); 233 233 if(strpos($q, '%3A')!==false) trunk/lib/jelix/core/jUrl.class.php
r699 r716 229 229 static $url = false; 230 230 if ($url === false){ 231 $url = 'http://'.$_SERVER['HTTP_HOST'].$ _SERVER['SCRIPT_NAME'].$GLOBALS['gJCoord']->request->url_path_info.'?';231 $url = 'http://'.$_SERVER['HTTP_HOST'].$GLOBALS['gJCoord']->request->urlScript.$GLOBALS['gJCoord']->request->urlPathInfo.'?'; 232 232 $q = http_build_query($_GET, '', ($forxml?'&':'&')); 233 233 if(strpos($q, '%3A')!==false) trunk/lib/jelix/core/request/jClassicRequest.class.php
r338 r716 25 25 protected function _initParams(){ 26 26 27 $url = jUrl::parse($ _SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET);27 $url = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 28 28 $this->params = array_merge($url->params, $_POST); 29 29 } trunk/lib/jelix/core/request/jClassicRequest.class.php
r338 r716 25 25 protected function _initParams(){ 26 26 27 $url = jUrl::parse($ _SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET);27 $url = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 28 28 $this->params = array_merge($url->params, $_POST); 29 29 } trunk/lib/jelix/core/request/jCmdLineRequest.class.php
r693 r716 25 25 protected function _initUrlDatas(){ 26 26 global $gJConfig; 27 $this->url_script_path = '/';28 $this->url_script_name = $ _SERVER['SCRIPT_NAME'];29 $this->url_path_info = '';27 $this->url_script_path = $this->urlScriptPath = '/'; 28 $this->url_script_name = $this->urlScriptName = $this->urlScript = $_SERVER['SCRIPT_NAME']; 29 $this->url_path_info = $this->urlPathInfo = ''; 30 30 } 31 31 trunk/lib/jelix/core/request/jCmdLineRequest.class.php
r693 r716 25 25 protected function _initUrlDatas(){ 26 26 global $gJConfig; 27 $this->url_script_path = '/';28 $this->url_script_name = $ _SERVER['SCRIPT_NAME'];29 $this->url_path_info = '';27 $this->url_script_path = $this->urlScriptPath = '/'; 28 $this->url_script_name = $this->urlScriptName = $this->urlScript = $_SERVER['SCRIPT_NAME']; 29 $this->url_path_info = $this->urlPathInfo = ''; 30 30 } 31 31 trunk/lib/jelix/core/request/jCssRequest.class.php
r338 r716 23 23 24 24 protected function _initParams(){ 25 $url = jUrl::parse($ _SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET);25 $url = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 26 26 $this->params = array_merge($url->params, $_POST); 27 27 } trunk/lib/jelix/core/request/jCssRequest.class.php
r338 r716 23 23 24 24 protected function _initParams(){ 25 $url = jUrl::parse($ _SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET);25 $url = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 26 26 $this->params = array_merge($url->params, $_POST); 27 27 } trunk/lib/jelix/core/request/jRdfRequest.class.php
r338 r716 23 23 24 24 protected function _initParams(){ 25 $url = jUrl::parse($ _SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET);25 $url = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 26 26 $this->params = array_merge($url->params, $_POST); 27 27 } trunk/lib/jelix/core/request/jRdfRequest.class.php
r338 r716 23 23 24 24 protected function _initParams(){ 25 $url = jUrl::parse($ _SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET);25 $url = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 26 26 $this->params = array_merge($url->params, $_POST); 27 27 } trunk/lib/jelix/core/request/jXulRequest.class.php
r699 r716 23 23 24 24 protected function _initParams(){ 25 $url = jUrl::parse($ _SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET);25 $url = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 26 26 $this->params = array_merge($url->params, $_POST); 27 27 } trunk/lib/jelix/core/request/jXulRequest.class.php
r699 r716 23 23 24 24 protected function _initParams(){ 25 $url = jUrl::parse($ _SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET);25 $url = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 26 26 $this->params = array_merge($url->params, $_POST); 27 27 } trunk/lib/jelix/plugins/urls/simple/simple.urls.php
r691 r716 64 64 protected function getScript($requestType, $module=null, $action=null){ 65 65 global $gJConfig; 66 66 67 67 $script = $gJConfig->urlengine['defaultEntrypoint']; 68 68 trunk/lib/jelix/plugins/urls/simple/simple.urls.php
r691 r716 64 64 protected function getScript($requestType, $module=null, $action=null){ 65 65 global $gJConfig; 66 66 67 67 $script = $gJConfig->urlengine['defaultEntrypoint']; 68 68 trunk/myapp/var/config/defaultconfig.ini.php
r691 r716 73 73 basePath = "" 74 74 75 76 75 defaultEntrypoint= index 77 76 … … 79 78 80 79 ;notfoundAct = "jelix~error:notfound" 81 82 ;indique si vous utilisez IIS comme serveur83 useIIS = off84 85 ;indique le paramètre dans $_GET où est indiqué le path_info86 IISPathKey = __JELIX_URL__87 88 ;indique si il faut stripslashé le path_info récupéré par le biais de IISPathKey89 IISStripslashesPathKey = on90 80 91 81 trunk/myapp/var/config/defaultconfig.ini.php
r691 r716 73 73 basePath = "" 74 74 75 76 75 defaultEntrypoint= index 77 76 … … 79 78 80 79 ;notfoundAct = "jelix~error:notfound" 81 82 ;indique si vous utilisez IIS comme serveur83 useIIS = off84 85 ;indique le paramètre dans $_GET où est indiqué le path_info86 IISPathKey = __JELIX_URL__87 88 ;indique si il faut stripslashé le path_info récupéré par le biais de IISPathKey89 IISStripslashesPathKey = on90 80 91 81 trunk/testapp/INSTALL.txt
r689 r716 1 1 Installation of testapp 2 2 3 - download and install a "developer" edition of Jelix 4 - move the testapp directory at the same level of the lib/ directory of jelix. 3 5 - create a database and import one of the testapp/install/*.sql script into it. 4 6 - rename testapp/var/config/dbprofils.ini.php.dist to testapp/var/config/dbprofils.ini.php trunk/testapp/INSTALL.txt
r689 r716 1 1 Installation of testapp 2 2 3 - download and install a "developer" edition of Jelix 4 - move the testapp directory at the same level of the lib/ directory of jelix. 3 5 - create a database and import one of the testapp/install/*.sql script into it. 4 6 - rename testapp/var/config/dbprofils.ini.php.dist to testapp/var/config/dbprofils.ini.php trunk/testapp/modules/jelix_tests/tests/core.old_urls_generation.html.php
r695 r716 29 29 global $gJCoord, $gJConfig; 30 30 31 $this->oldUrlScriptPath = $gJCoord->request->url _script_path;31 $this->oldUrlScriptPath = $gJCoord->request->urlScriptPath; 32 32 $this->oldParams = $gJCoord->request->params; 33 33 $this->oldRequestType = $gJCoord->request->type; … … 44 44 global $gJCoord, $gJConfig; 45 45 46 $gJCoord->request->url _script_path=$this->oldUrlScriptPath;46 $gJCoord->request->urlScriptPath=$this->oldUrlScriptPath; 47 47 $gJCoord->request->params=$this->oldParams; 48 48 $gJCoord->request->type=$this->oldRequestType; … … 104 104 if(!$this->enableTest) return; 105 105 106 $gJCoord->request->url _script_path='/';106 $gJCoord->request->urlScriptPath='/'; 107 107 $gJCoord->request->params=array(); 108 108 //$gJCoord->request->type=; … … 176 176 global $gJConfig, $gJCoord; 177 177 178 $gJCoord->request->url _script_path='/';178 $gJCoord->request->urlScriptPath='/'; 179 179 $gJCoord->request->params=array(); 180 180 //$gJCoord->request->type=; … … 220 220 global $gJConfig, $gJCoord; 221 221 222 $gJCoord->request->url _script_path='/';222 $gJCoord->request->urlScriptPath='/'; 223 223 $gJCoord->request->params=array(); 224 224 //$gJCoord->request->type=; … … 332 332 global $gJConfig, $gJCoord; 333 333 334 $gJCoord->request->url _script_path='/';334 $gJCoord->request->urlScriptPath='/'; 335 335 $gJCoord->request->params=array(); 336 336 //$gJCoord->request->type=; trunk/testapp/modules/jelix_tests/tests/core.old_urls_generation.html.php
r695 r716 29 29 global $gJCoord, $gJConfig; 30 30 31 $this->oldUrlScriptPath = $gJCoord->request->url _script_path;31 $this->oldUrlScriptPath = $gJCoord->request->urlScriptPath; 32 32 $this->oldParams = $gJCoord->request->params; 33 33 $this->oldRequestType = $gJCoord->request->type; … … 44 44 global $gJCoord, $gJConfig; 45 45 46 $gJCoord->request->url _script_path=$this->oldUrlScriptPath;46 $gJCoord->request->urlScriptPath=$this->oldUrlScriptPath; 47 47 $gJCoord->request->params=$this->oldParams; 48 48 $gJCoord->request->type=$this->oldRequestType; … … 104 104 if(!$this->enableTest) return; 105 105 106 $gJCoord->request->url _script_path='/';106 $gJCoord->request->urlScriptPath='/'; 107 107 $gJCoord->request->params=array(); 108 108 //$gJCoord->request->type=; … … 176 176 global $gJConfig, $gJCoord; 177 177 178 $gJCoord->request->url _script_path='/';178 $gJCoord->request->urlScriptPath='/'; 179 179 $gJCoord->request->params=array(); 180 180 //$gJCoord->request->type=; … … 220 220 global $gJConfig, $gJCoord; 221 221 222 $gJCoord->request->url _script_path='/';222 $gJCoord->request->urlScriptPath='/'; 223 223 $gJCoord->request->params=array(); 224 224 //$gJCoord->request->type=; … … 332 332 global $gJConfig, $gJCoord; 333 333 334 $gJCoord->request->url _script_path='/';334 $gJCoord->request->urlScriptPath='/'; 335 335 $gJCoord->request->params=array(); 336 336 //$gJCoord->request->type=; trunk/testapp/modules/jelix_tests/tests/core.old_urls_parsing.html.php
