Changeset 716

Show
Ignore:
Timestamp:
12/30/07 18:28:50 (1 year ago)
Author:
laurentj
Message:

worked on ticket #390: bad behaviors about urls when running jelix on a server with PHP-CGI or SUPHP

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/manifests/testapp.mn

    r708 r716  
    118118cd testapp/modules/jelix_tests/tests/ 
    119119  core.jlocale.html.php 
     120  core.jrequest.html_cli.php 
    120121  core.selectors_action.html.php 
    121122  core.old_selectors_action.html.php 
  • trunk/build/manifests/testapp.mn

    r708 r716  
    118118cd testapp/modules/jelix_tests/tests/ 
    119119  core.jlocale.html.php 
     120  core.jrequest.html_cli.php 
    120121  core.selectors_action.html.php 
    121122  core.old_selectors_action.html.php 
  • trunk/lib/jelix-scripts/templates/var/config/defaultconfig.ini.php.tpl

    r691 r716  
    7878;notfoundAct = "jelix~error:notfound" 
    7979 
    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 
     81simple_urlengine_https = 
    8882 
    8983 
  • trunk/lib/jelix-scripts/templates/var/config/defaultconfig.ini.php.tpl

    r691 r716  
    7878;notfoundAct = "jelix~error:notfound" 
    7979 
    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 
     81simple_urlengine_https = 
    8882 
    8983 
  • trunk/lib/jelix/core/defaultconfig.ini.php

    r696 r716  
    102102multiview = off 
    103103 
     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 
     109scriptNameServerVariable =  
     110 
     111 
    104112; basePath corresponds to the path to the base directory of your application. 
    105113; so if the url to access to your application is http://foo.com/aaa/bbb/www/index.php, you should 
     
    125133notfoundAct = 
    126134;notfoundAct = "jelix~error:notfound" 
    127  
    128 ;if you use IIS as a serveur set it to on 
    129 useIIS = off 
    130  
    131 ;if you use IIS, indicate the parameter which contains the path_info 
    132 IISPathKey = __JELIX_URL__ 
    133  
    134 ;indique si il faut stripslashé le path_info récupéré par le biais de IISPathKey 
    135 IISStripslashes_path_key = on 
    136135 
    137136; liste des actions requerant https (syntaxe expliquée dessous), pour le moteur d'url simple 
  • trunk/lib/jelix/core/defaultconfig.ini.php

    r696 r716  
    102102multiview = off 
    103103 
     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 
     109scriptNameServerVariable =  
     110 
     111 
    104112; basePath corresponds to the path to the base directory of your application. 
    105113; so if the url to access to your application is http://foo.com/aaa/bbb/www/index.php, you should 
     
    125133notfoundAct = 
    126134;notfoundAct = "jelix~error:notfound" 
    127  
    128 ;if you use IIS as a serveur set it to on 
    129 useIIS = off 
    130  
    131 ;if you use IIS, indicate the parameter which contains the path_info 
    132 IISPathKey = __JELIX_URL__ 
    133  
    134 ;indique si il faut stripslashé le path_info récupéré par le biais de IISPathKey 
    135 IISStripslashes_path_key = on 
    136135 
    137136; liste des actions requerant https (syntaxe expliquée dessous), pour le moteur d'url simple 
  • trunk/lib/jelix/core/jConfigCompiler.class.php

    r699 r716  
    5757            $config->_trustedModules = array_keys($config->_modulesPathList); 
    5858        } 
     59 
     60        if($config->urlengine['scriptNameServerVariable'] == '') { 
     61            $config->urlengine['scriptNameServerVariable'] = self::_findServerName($config->urlengine['entrypointExtension']); 
     62        } 
     63 
    5964        $path=$config->urlengine['basePath']; 
    6065        if($path!='/' && $path!=''){ 
     
    107112            $config['_trustedModules'] = array_keys($config['_modulesPathList']); 
    108113        } 
     114 
     115        if($config['urlengine']['scriptNameServerVariable'] == '') { 
     116            $config['urlengine']['scriptNameServerVariable'] = self::_findServerName($config['urlengine']['entrypointExtension']); 
     117        } 
     118 
    109119        $path=$config['urlengine']['basePath']; 
    110120        if($path!='/' && $path!=''){ 
     
    262272    } 
    263273 
     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 
    264290#ifnot ENABLE_PHP_JELIX 
    265291    /** 
  • trunk/lib/jelix/core/jConfigCompiler.class.php

    r699 r716  
    5757            $config->_trustedModules = array_keys($config->_modulesPathList); 
    5858        } 
     59 
     60        if($config->urlengine['scriptNameServerVariable'] == '') { 
     61            $config->urlengine['scriptNameServerVariable'] = self::_findServerName($config->urlengine['entrypointExtension']); 
     62        } 
     63 
    5964        $path=$config->urlengine['basePath']; 
    6065        if($path!='/' && $path!=''){ 
     
    107112            $config['_trustedModules'] = array_keys($config['_modulesPathList']); 
    108113        } 
     114 
     115        if($config['urlengine']['scriptNameServerVariable'] == '') { 
     116            $config['urlengine']['scriptNameServerVariable'] = self::_findServerName($config['urlengine']['entrypointExtension']); 
     117        } 
     118 
    109119        $path=$config['urlengine']['basePath']; 
    110120        if($path!='/' && $path!=''){ 
     
    262272    } 
    263273 
     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 
    264290#ifnot ENABLE_PHP_JELIX 
    265291    /** 
  • trunk/lib/jelix/core/jRequest.class.php

    r699 r716  
    4040 
    4141    /** 
     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    /** 
    4256     * 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 
    4473     */ 
    4574    public $url_script_path; 
    4675 
    4776    /** 
    48      * the name of the entry point 
    49      * @var string 
     77     * @var string 
     78     * @deprecated see $urlScriptName 
    5079     */ 
    5180    public $url_script_name; 
    5281 
    5382    /** 
    54      * the pathinfo part of the url 
    55      * @var string 
     83     * @var string 
     84     * @deprecated see $urlPathInfo 
    5685     */ 
    5786    public $url_path_info; 
     87 
     88 
    5889 
    5990    function __construct(){  } 
     
    73104 
    74105    /** 
    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 
    81107     */ 
    82108    protected function _initUrlDatas(){ 
    83109        global $gJConfig; 
    84110 
    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 
    87119        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; 
    89121            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.php 
     122                $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); 
    96128 
    97129        if(isset($_SERVER['PATH_INFO'])){ 
    98130            $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; 
    116147    } 
    117148 
  • trunk/lib/jelix/core/jRequest.class.php

    r699 r716  
    4040 
    4141    /** 
     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    /** 
    4256     * 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 
    4473     */ 
    4574    public $url_script_path; 
    4675 
    4776    /** 
    48      * the name of the entry point 
    49      * @var string 
     77     * @var string 
     78     * @deprecated see $urlScriptName 
    5079     */ 
    5180    public $url_script_name; 
    5281 
    5382    /** 
    54      * the pathinfo part of the url 
    55      * @var string 
     83     * @var string 
     84     * @deprecated see $urlPathInfo 
    5685     */ 
    5786    public $url_path_info; 
     87 
     88 
    5889 
    5990    function __construct(){  } 
     
    73104 
    74105    /** 
    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 
    81107     */ 
    82108    protected function _initUrlDatas(){ 
    83109        global $gJConfig; 
    84110 
    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 
    87119        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; 
    89121            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.php 
     122                $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); 
    96128 
    97129        if(isset($_SERVER['PATH_INFO'])){ 
    98130            $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; 
    116147    } 
    117148 
  • trunk/lib/jelix/core/jUrl.class.php

    r699 r716  
    229229        static $url = false; 
    230230        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.'?'; 
    232232            $q = http_build_query($_GET, '', ($forxml?'&':'&')); 
    233233            if(strpos($q, '%3A')!==false) 
  • trunk/lib/jelix/core/jUrl.class.php

    r699 r716  
    229229        static $url = false; 
    230230        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.'?'; 
    232232            $q = http_build_query($_GET, '', ($forxml?'&':'&')); 
    233233            if(strpos($q, '%3A')!==false) 
  • trunk/lib/jelix/core/request/jClassicRequest.class.php

    r338 r716  
    2525    protected function _initParams(){ 
    2626 
    27         $url  = jUrl::parse($_SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET); 
     27        $url  = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 
    2828        $this->params = array_merge($url->params, $_POST); 
    2929    } 
  • trunk/lib/jelix/core/request/jClassicRequest.class.php

    r338 r716  
    2525    protected function _initParams(){ 
    2626 
    27         $url  = jUrl::parse($_SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET); 
     27        $url  = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 
    2828        $this->params = array_merge($url->params, $_POST); 
    2929    } 
  • trunk/lib/jelix/core/request/jCmdLineRequest.class.php

    r693 r716  
    2525    protected function _initUrlDatas(){  
    2626        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 = '';  
    3030    } 
    3131 
  • trunk/lib/jelix/core/request/jCmdLineRequest.class.php

    r693 r716  
    2525    protected function _initUrlDatas(){  
    2626        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 = '';  
    3030    } 
    3131 
  • trunk/lib/jelix/core/request/jCssRequest.class.php

    r338 r716  
    2323 
    2424    protected function _initParams(){ 
    25         $url  = jUrl::parse($_SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET); 
     25        $url  = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 
    2626        $this->params = array_merge($url->params, $_POST); 
    2727    } 
  • trunk/lib/jelix/core/request/jCssRequest.class.php

    r338 r716  
    2323 
    2424    protected function _initParams(){ 
    25         $url  = jUrl::parse($_SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET); 
     25        $url  = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 
    2626        $this->params = array_merge($url->params, $_POST); 
    2727    } 
  • trunk/lib/jelix/core/request/jRdfRequest.class.php

    r338 r716  
    2323 
    2424    protected function _initParams(){ 
    25         $url  = jUrl::parse($_SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET); 
     25        $url  = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 
    2626        $this->params = array_merge($url->params, $_POST); 
    2727    } 
  • trunk/lib/jelix/core/request/jRdfRequest.class.php

    r338 r716  
    2323 
    2424    protected function _initParams(){ 
    25         $url  = jUrl::parse($_SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET); 
     25        $url  = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 
    2626        $this->params = array_merge($url->params, $_POST); 
    2727    } 
  • trunk/lib/jelix/core/request/jXulRequest.class.php

    r699 r716  
    2323 
    2424    protected function _initParams(){ 
    25         $url  = jUrl::parse($_SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET); 
     25        $url  = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 
    2626        $this->params = array_merge($url->params, $_POST); 
    2727    } 
  • trunk/lib/jelix/core/request/jXulRequest.class.php

    r699 r716  
    2323 
    2424    protected function _initParams(){ 
    25         $url  = jUrl::parse($_SERVER['SCRIPT_NAME'], $this->url_path_info, $_GET); 
     25        $url  = jUrl::parse($this->urlScript, $this->urlPathInfo, $_GET); 
    2626        $this->params = array_merge($url->params, $_POST); 
    2727    } 
  • trunk/lib/jelix/plugins/urls/simple/simple.urls.php

    r691 r716  
    6464    protected function getScript($requestType, $module=null, $action=null){ 
    6565        global $gJConfig; 
    66          
     66 
    6767        $script = $gJConfig->urlengine['defaultEntrypoint']; 
    6868 
  • trunk/lib/jelix/plugins/urls/simple/simple.urls.php

    r691 r716  
    6464    protected function getScript($requestType, $module=null, $action=null){ 
    6565        global $gJConfig; 
    66          
     66 
    6767        $script = $gJConfig->urlengine['defaultEntrypoint']; 
    6868 
  • trunk/myapp/var/config/defaultconfig.ini.php

    r691 r716  
    7373basePath = "" 
    7474 
    75  
    7675defaultEntrypoint= index 
    7776 
     
    7978 
    8079;notfoundAct = "jelix~error:notfound" 
    81  
    82 ;indique si vous utilisez IIS comme serveur 
    83 useIIS = off 
    84  
    85 ;indique le paramètre dans $_GET où est indiqué le path_info 
    86 IISPathKey = __JELIX_URL__ 
    87  
    88 ;indique si il faut stripslashé le path_info récupéré par le biais de IISPathKey 
    89 IISStripslashesPathKey = on 
    9080 
    9181 
  • trunk/myapp/var/config/defaultconfig.ini.php

    r691 r716  
    7373basePath = "" 
    7474 
    75  
    7675defaultEntrypoint= index 
    7776 
     
    7978 
    8079;notfoundAct = "jelix~error:notfound" 
    81  
    82 ;indique si vous utilisez IIS comme serveur 
    83 useIIS = off 
    84  
    85 ;indique le paramètre dans $_GET où est indiqué le path_info 
    86 IISPathKey = __JELIX_URL__ 
    87  
    88 ;indique si il faut stripslashé le path_info récupéré par le biais de IISPathKey 
    89 IISStripslashesPathKey = on 
    9080 
    9181 
  • trunk/testapp/INSTALL.txt

    r689 r716  
    11Installation of testapp 
    22 
     3- download and install a "developer" edition of Jelix 
     4- move the testapp directory at the same level of the lib/ directory of jelix. 
    35- create a database and import one of the testapp/install/*.sql script into it. 
    46- rename testapp/var/config/dbprofils.ini.php.dist to testapp/var/config/dbprofils.ini.php 
  • trunk/testapp/INSTALL.txt

    r689 r716  
    11Installation of testapp 
    22 
     3- download and install a "developer" edition of Jelix 
     4- move the testapp directory at the same level of the lib/ directory of jelix. 
    35- create a database and import one of the testapp/install/*.sql script into it. 
    46- 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  
    2929      global $gJCoord, $gJConfig; 
    3030 
    31       $this->oldUrlScriptPath = $gJCoord->request->url_script_path; 
     31      $this->oldUrlScriptPath = $gJCoord->request->urlScriptPath; 
    3232      $this->oldParams = $gJCoord->request->params; 
    3333      $this->oldRequestType = $gJCoord->request->type; 
     
    4444      global $gJCoord, $gJConfig; 
    4545 
    46       $gJCoord->request->url_script_path=$this->oldUrlScriptPath; 
     46      $gJCoord->request->urlScriptPath=$this->oldUrlScriptPath; 
    4747      $gJCoord->request->params=$this->oldParams; 
    4848      $gJCoord->request->type=$this->oldRequestType; 
     
    104104       if(!$this->enableTest) return; 
    105105 
    106        $gJCoord->request->url_script_path='/'; 
     106       $gJCoord->request->urlScriptPath='/'; 
    107107       $gJCoord->request->params=array(); 
    108108       //$gJCoord->request->type=; 
     
    176176       global $gJConfig, $gJCoord; 
    177177 
    178        $gJCoord->request->url_script_path='/'; 
     178       $gJCoord->request->urlScriptPath='/'; 
    179179       $gJCoord->request->params=array(); 
    180180       //$gJCoord->request->type=; 
     
    220220       global $gJConfig, $gJCoord; 
    221221 
    222        $gJCoord->request->url_script_path='/'; 
     222       $gJCoord->request->urlScriptPath='/'; 
    223223       $gJCoord->request->params=array(); 
    224224       //$gJCoord->request->type=; 
     
    332332       global $gJConfig, $gJCoord; 
    333333 
    334        $gJCoord->request->url_script_path='/'; 
     334       $gJCoord->request->urlScriptPath='/'; 
    335335       $gJCoord->request->params=array(); 
    336336       //$gJCoord->request->type=; 
  • trunk/testapp/modules/jelix_tests/tests/core.old_urls_generation.html.php

    r695 r716  
    2929      global $gJCoord, $gJConfig; 
    3030 
    31       $this->oldUrlScriptPath = $gJCoord->request->url_script_path; 
     31      $this->oldUrlScriptPath = $gJCoord->request->urlScriptPath; 
    3232      $this->oldParams = $gJCoord->request->params; 
    3333      $this->oldRequestType = $gJCoord->request->type; 
     
    4444      global $gJCoord, $gJConfig; 
    4545 
    46       $gJCoord->request->url_script_path=$this->oldUrlScriptPath; 
     46      $gJCoord->request->urlScriptPath=$this->oldUrlScriptPath; 
    4747      $gJCoord->request->params=$this->oldParams; 
    4848      $gJCoord->request->type=$this->oldRequestType; 
     
    104104       if(!$this->enableTest) return; 
    105105 
    106        $gJCoord->request->url_script_path='/'; 
     106       $gJCoord->request->urlScriptPath='/'; 
    107107       $gJCoord->request->params=array(); 
    108108       //$gJCoord->request->type=; 
     
    176176       global $gJConfig, $gJCoord; 
    177177 
    178        $gJCoord->request->url_script_path='/'; 
     178       $gJCoord->request->urlScriptPath='/'; 
    179179       $gJCoord->request->params=array(); 
    180180       //$gJCoord->request->type=; 
     
    220220       global $gJConfig, $gJCoord; 
    221221 
    222        $gJCoord->request->url_script_path='/'; 
     222       $gJCoord->request->urlScriptPath='/'; 
    223223       $gJCoord->request->params=array(); 
    224224       //$gJCoord->request->type=; 
     
    332332       global $gJConfig, $gJCoord; 
    333333 
    334        $gJCoord->request->url_script_path='/'; 
     334       $gJCoord->request->urlScriptPath='/'; 
    335335       $gJCoord->request->params=array(); 
    336336       //$gJCoord->request->type=; 
  • trunk/testapp/modules/jelix_tests/tests/core.old_urls_parsing.html.php