Changeset 267
- Timestamp:
- 09/30/06 00:19:42 (2 years ago)
- Files:
-
- trunk/build/phpdoc/Converters/HTML/frames/templates/DOM/jelix/templates/top_frame.tpl (modified) (3 diffs)
- trunk/lib/jelix/core/defaultconfig.ini.php (modified) (1 diff)
- trunk/lib/jelix/core/jConfigCompiler.class.php (modified) (1 diff)
- trunk/lib/jelix/core/url/jUrlCompiler.significant.class.php (modified) (7 diffs)
- trunk/lib/jelix/core/url/jUrlEngine.significant.class.php (modified) (4 diffs)
- trunk/lib/jelix/core/url/jUrlEngine.simple.class.php (modified) (2 diffs)
- trunk/lib/jelix/docs/ns/dao.rng (modified) (6 diffs)
- trunk/lib/jelix/docs/ns/urls.rng (modified) (3 diffs)
- trunk/testapp/modules/unittest/classes/utcreateurls.class.php (modified) (9 diffs)
- trunk/testapp/var/config/defaultconfig.ini.php.dist (modified) (2 diffs)
- trunk/testapp/var/config/urls.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/build/phpdoc/Converters/HTML/frames/templates/DOM/jelix/templates/top_frame.tpl
r236 r267 10 10 <body> 11 11 <div id="header"> 12 12 13 13 <div id="introduction"> 14 14 <h1><a href="{$subdir}index.html" >Documentation API Reference</a></h1> 15 15 </div> 16 16 <div id="telechargement"> 17 18 17 18 19 19 </div> 20 20 <div> 21 21 </div> 22 <div id="chemin"> 22 <div id="chemin"> 23 23 {if count($packages) > 1} 24 24 {assign var="last_p" value=""} … … 31 31 <br/> 32 32 {/if} 33 33 34 34 {if count($ric) >= 1} 35 35 {assign var="last_ric_name" value=""} … … 43 43 </div> 44 44 </div> 45 45 46 46 <div id="sidemenu"> 47 <h1><a href="http://jelix.org" t itle="retour sur la page d'accueil du site"><img src="{$subdir}media/logo_jelix_moyen.png" alt="Jelix" /></a></h1>47 <h1><a href="http://jelix.org" target="_top" title="retour sur la page d'accueil du site"><img src="{$subdir}media/logo_jelix_moyen.png" alt="Jelix" /></a></h1> 48 48 </div> 49 49 50 50 </body> 51 51 </html> trunk/lib/jelix/core/defaultconfig.ini.php
r263 r267 106 106 IISStripslashes_path_key = on 107 107 108 ; liste des actions requerant https (syntaxe expliqu�dessous), pour le moteur d'url simple 109 simple_urlengine_https = 108 110 109 111 [simple_urlengine_entrypoints] trunk/lib/jelix/core/jConfigCompiler.class.php
r260 r267 170 170 fclose($f); 171 171 }else{ 172 trigger_error(' Can\'t write '.$filename.' file',E_USER_ERROR);172 trigger_error('Jelix can\'t write '.$filename.' file. Set correctly rights in the temp directory',E_USER_ERROR); 173 173 } 174 174 } trunk/lib/jelix/core/url/jUrlCompiler.significant.class.php
r248 r267 63 63 $CREATE_URL = array( 64 64 'news~show@classic' => 65 array(0,'entrypoint', 'handler')65 array(0,'entrypoint', https true/false, entrypoint true/false, 'handler') 66 66 ou 67 array(1,'entrypoint', 67 array(1,'entrypoint', https true/false, entrypoint true/false, 68 68 array('annee','mois','jour','id','titre'), // liste des param�es de l'url �rendre en compte 69 69 array(true, false..), // valeur des escapes … … 71 71 ) 72 72 ou 73 array(2,'entrypoint'); pour les cl�du type "@request" ou "module~@request" 73 array(2,'entrypoint', https true/false, entrypoint true/false ); pour les cl�du type "@request" 74 array(3,'entrypoint', https true/false, entrypoint true/false ); pour les cl�du type "module~@request" 74 75 75 76 */ … … 90 91 $entryPoint = (string)$tag['name']; 91 92 $isDefault = (isset($tag['default']) ? (((string)$tag['default']) == 'true'):false); 93 $isHttps = (isset($tag['https']) ? (((string)$tag['https']) == 'true'):false); 94 $generatedentrypoint =$entryPoint; 95 if(isset($tag['noentrypoint']) && (string)$tag['noentrypoint'] == 'true') 96 $generatedentrypoint = ''; 92 97 $parseInfos = array($isDefault); 93 98 … … 95 100 // toutes les urls qui ne correspondent pas aux autres r�es 96 101 if($isDefault){ 97 $createUrlInfos['@'.$requestType]=array(2,$entryPoint );102 $createUrlInfos['@'.$requestType]=array(2,$entryPoint, $isHttps); 98 103 } 99 104 … … 101 106 foreach($tag->url as $url){ 102 107 $module = (string)$url['module']; 103 108 if(isset($url['https'])){ 109 $urlhttps=(((string)$url['https']) == 'true'); 110 }else{ 111 $urlhttps=$isHttps; 112 } 113 if(isset($url['noentrypoint']) && ((string)$url['noentrypoint']) == 'true'){ 114 $urlep=''; 115 }else{ 116 $urlep=$generatedentrypoint; 117 } 104 118 // dans le cas d'un point d'entr�qui n'est pas celui par d�ut pour le type de requete indiqu� // si il y a juste un module indiqu�lors on sait que toutes les actions 105 119 // concernant ce module passeront par ce point d'entr� 106 120 if(!$isDefault && !isset($url['action']) && !isset($url['handler'])){ 107 121 $parseInfos[]=array($module, '', '/.*/', array(), array(), array(), false ); 108 $createUrlInfos[$module.'~*@'.$requestType] = array(3,$ entryPoint);122 $createUrlInfos[$module.'~*@'.$requestType] = array(3,$urlep, $urlhttps); 109 123 continue; 110 124 } … … 123 137 $createUrlContent.="include_once('".$s->getPath()."');\n"; 124 138 $parseInfos[]=array($module, $action, $class, $actionOverride ); 125 $createUrlInfos[$module.'~'.$action.'@'.$requestType] = array(0,$ entryPoint, $class);139 $createUrlInfos[$module.'~'.$action.'@'.$requestType] = array(0,$urlep, $urlhttps, $class); 126 140 if($actionOverride){ 127 141 foreach($actionOverride as $ao){ 128 $createUrlInfos[$module.'~'.$ao.'@'.$requestType] = array(0,$ entryPoint, $class);142 $createUrlInfos[$module.'~'.$ao.'@'.$requestType] = array(0,$urlep,$urlhttps, $class); 129 143 } 130 144 } … … 187 201 } 188 202 $parseInfos[]=array($module, $action, '!^'.$regexppath.'$!', $listparam, $escapes, $liststatics, $actionOverride ); 189 $createUrlInfos[$module.'~'.$action.'@'.$requestType] = array(1,$ entryPoint, $listparam, $escapes,$path);203 $createUrlInfos[$module.'~'.$action.'@'.$requestType] = array(1,$urlep, $urlhttps, $listparam, $escapes,$path); 190 204 if($actionOverride){ 191 205 foreach($actionOverride as $ao){ 192 $createUrlInfos[$module.'~'.$ao.'@'.$requestType] = array(1,$ entryPoint, $listparam, $escapes,$path);206 $createUrlInfos[$module.'~'.$ao.'@'.$requestType] = array(1,$urlep, $urlhttps, $listparam, $escapes,$path); 193 207 } 194 208 } trunk/lib/jelix/core/url/jUrlEngine.significant.class.php
r248 r267 285 285 /* 286 286 urlinfo = 287 array(0,'entrypoint', 'handler')287 array(0,'entrypoint', https true/false, entrypoint true/false,'handler') 288 288 ou 289 array(1,'entrypoint', 289 array(1,'entrypoint', https true/false, entrypoint true/false 290 290 array('annee','mois','jour','id','titre'), // liste des param�es de l'url �rendre en compte 291 291 array(true, false..), // valeur des escapes … … 293 293 ) 294 294 ou 295 array(2,'entrypoint'); pour les cl�du type "@request" ou "module~@request" 295 array(2,'entrypoint', https true/false, entrypoint true/false); pour les cl�du type "@request" 296 array(3,'entrypoint', https true/false, entrypoint true/false); pour les cl�du type "module~@request" 296 297 297 298 */ 298 299 299 300 $url->scriptName = $GLOBALS['gJConfig']->urlengine['basePath'].$urlinfo[1]; 300 if(!$GLOBALS['gJConfig']->urlengine['multiview']){ 301 if($urlinfo[2]) 302 $url->scriptName = 'https://'.$_SERVER['HTTP_HOST'].$url->scriptName; 303 304 if($urlinfo[1] && !$GLOBALS['gJConfig']->urlengine['multiview']){ 301 305 $url->scriptName.=$GLOBALS['gJConfig']->urlengine['entrypointExtension']; 302 306 } … … 311 315 312 316 if($urlinfo[0]==0){ 313 $s = new jSelectorUrlHandler($urlinfo[ 2]);317 $s = new jSelectorUrlHandler($urlinfo[3]); 314 318 $c ='URLS'.$s->resource; 315 319 $handler =new $c(); 316 320 $handler->create($urlact, $url); 317 321 }elseif($urlinfo[0]==1){ 318 $result = $urlinfo[ 4];319 foreach ($urlinfo[ 2] as $k=>$param){320 if($urlinfo[ 3][$k]){322 $result = $urlinfo[5]; 323 foreach ($urlinfo[3] as $k=>$param){ 324 if($urlinfo[4][$k]){ 321 325 $result=str_replace(':'.$param, jUrl::escape($url->getParam($param,''),true), $result); 322 326 }else{ … … 325 329 $url->delParam($param); 326 330 } 327 328 $url->pathInfo = $result; 331 if($urlinfo[1]) 332 $url->pathInfo = $result; 333 else 334 $url->pathInfo = substr($result,1); 335 329 336 }elseif($urlinfo[0]==3){ 330 337 $url->delParam('module'); trunk/lib/jelix/core/url/jUrlEngine.simple.class.php
r248 r267 62 62 protected function getScript($requestType, $module=null, $action=null){ 63 63 static $urlspe = null; 64 static $urlhttps = null; 64 65 global $gJConfig; 65 66 66 67 $script = $gJConfig->urlengine['defaultEntrypoint']; 68 69 if($urlhttps == null){ 70 $urlhttps=array(); 71 $selectors = preg_split("/[\s,]+/", $gJConfig->urlengine['simple_urlengine_https']); 72 foreach($selectors as $sel2){ 73 $urlhttps[$sel2]= true; 74 } 75 } 76 77 $usehttps= false; 78 if($action && $action !='' && isset($urlhttps[$module.'~'.$action.'@'.$requestType])){ 79 $usehttps = true; 80 } 81 if($module && $module !='' && !$usehttps && isset($urlhttps[$module.'~*@'.$requestType])){ 82 $usehttps = true; 83 } 84 if(!$usehttps && isset($urlhttps['@'.$requestType])){ 85 $usehttps = true; 86 } 87 67 88 68 89 if(count($gJConfig->simple_urlengine_entrypoints)){ … … 92 113 $script.=$gJConfig->urlengine['entrypointExtension']; 93 114 } 94 return $gJConfig->urlengine['basePath'].$script; 115 116 if($usehttps){ 117 return 'https://'.$_SERVER['HTTP_HOST'].$gJConfig->urlengine['basePath'].$script; 118 }else{ 119 return $gJConfig->urlengine['basePath'].$script; 120 } 95 121 } 96 122 } trunk/lib/jelix/docs/ns/dao.rng
r149 r267 62 62 <optional><attribute name="minlength"><data type="int" /></attribute></optional> 63 63 <optional><attribute name="maxlength"><data type="int" /></attribute></optional> 64 <optional><attribute name="required"><data type="boolean" /></attribute></optional>65 64 <optional><attribute name="regexp" /></optional> 66 65 <optional><attribute name="sequence" /></optional> … … 144 143 <element name="parameter"> 145 144 <attribute name="name" /> 145 <optional><attribute name="default" /></optional> 146 146 <empty/> 147 147 </element> … … 156 156 <value>and</value> 157 157 <value>or</value> 158 <value>AND</value> 159 <value>OR</value> 158 160 </choice> 159 161 </attribute> … … 162 164 <choice> 163 165 <element name="eq"><ref name="method.condition.attr" /></element> 164 <element name="n oteq"><ref name="method.condition.attr" /></element>166 <element name="neq"><ref name="method.condition.attr" /></element> 165 167 <element name="lt"><ref name="method.condition.attr" /></element> 166 168 <element name="gt"><ref name="method.condition.attr" /></element> 167 169 <element name="lteq"><ref name="method.condition.attr" /></element> 168 170 <element name="gteq"><ref name="method.condition.attr" /></element> 171 <element name="like"><ref name="method.condition.attr" /></element> 172 <element name="notlike"><ref name="method.condition.attr" /></element> 169 173 <element name="isnull"><ref name="method.condition.attr.null" /></element> 170 <element name=" notisnull"><ref name="method.condition.attr.null" /></element>174 <element name="isnotnull"><ref name="method.condition.attr.null" /></element> 171 175 <element name="in"><ref name="method.condition.attr" /></element> 172 176 <element name="notin"><ref name="method.condition.attr" /></element> 177 <element name="binary_op"><ref name="method.condition.attr.binaryop" /></element> 178 173 179 <ref name="method.conditions" /> 174 180 </choice> … … 192 198 </define> 193 199 194 200 <define name="method.condition.attr.binaryop"> 201 <attribute name="property" /> 202 <choice> 203 <attribute name="value" /> 204 <attribute name="expr" /> 205 </choice> 206 <attribute name="operator" /> 207 <optional><attribute name="driver" /></optional> 208 <empty /> 209 </define> 195 210 196 211 <define name="method.values"> … … 222 237 <value>ASC</value> 223 238 <value>DESC</value> 239 <value>asc</value> 240 <value>desc</value> 224 241 </choice> 225 242 </attribute> trunk/lib/jelix/docs/ns/urls.rng
r94 r267 20 20 <name>xmlrpcentrypoint</name> 21 21 <name>jsonrpcentrypoint</name> 22 <name>rdfentrypoint</name> 23 <name>xmlentrypoint</name> 24 <name>xulentrypoint</name> 22 25 </choice> 23 26 24 27 <optional><attribute name="default"><data type="boolean"/></attribute></optional> 28 <optional> <attribute name="noentrypoint"><data type="boolean"/></attribute> </optional> 29 <optional> <attribute name="https"><data type="boolean"/></attribute> </optional> 30 25 31 <attribute name="name"/> 26 32 <zeroOrMore> … … 36 42 <element name="url"> 37 43 <attribute name="module" /> 44 <optional> <attribute name="noentrypoint"><data type="boolean"/></attribute> </optional> 45 <optional> <attribute name="https"><data type="boolean"/></attribute> </optional> 38 46 <optional> 39 47 <attribute name="action" /> … … 56 64 <define name="url.handler"> 57 65 <element name="url"> 66 <attribute name="module" /> 67 <optional> <attribute name="noentrypoint"><data type="boolean"/></attribute> </optional> 68 <optional> <attribute name="https"><data type="boolean"/></attribute> </optional> 58 69 <attribute name="handler" /> 59 <attribute name="module" />60 70 <optional> 61 71 <attribute name="action" /> trunk/testapp/modules/unittest/classes/utcreateurls.class.php
r247 r267 96 96 'defaultEntrypoint'=>'index', 97 97 'entrypointExtension'=>'.php', 98 'notfoundAct'=>'jelix~notfound' 98 'notfoundAct'=>'jelix~notfound', 99 'simple_urlengine_https'=>'unittest~urlsig_url8@classic @xmlrpc', 99 100 ); 100 101 /* $gJConfig->simple_urlengine_entrypoints = array( … … 115 116 $urlList[]= array('urlsig_url5', array('foo'=>'oof', 'bar'=>'rab')); 116 117 $urlList[]= array('jelix~bar@xmlrpc', array('aaa'=>'bbb')); 118 $urlList[]= array('unittest~urlsig_url8', array('rubrique'=>'vetements', 'id_article'=>'98')); 117 119 118 120 $trueResult=array( … … 123 125 "/index.php?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 124 126 "/xmlrpc.php", 125 ); 126 127 "/index.php?rubrique=vetements&id_article=98&module=unittest&action=urlsig_url8", 128 ); 129 130 131 $trueResult[5]='https://'.$_SERVER['HTTP_HOST'].$trueResult[5]; 132 $trueResult[6]='https://'.$_SERVER['HTTP_HOST'].$trueResult[6]; 127 133 $this->_doCompareUrl("simple, multiview = false", $urlList,$trueResult); 128 134 … … 135 141 "/index?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 136 142 "/xmlrpc", 137 ); 143 "/index?rubrique=vetements&id_article=98&module=unittest&action=urlsig_url8", 144 ); 145 $trueResult[5]='https://'.$_SERVER['HTTP_HOST'].$trueResult[5]; 146 $trueResult[6]='https://'.$_SERVER['HTTP_HOST'].$trueResult[6]; 138 147 $this->_doCompareUrl("simple, multiview = true", $urlList,$trueResult); 139 148 … … 155 164 'defaultEntrypoint'=>'index', 156 165 'entrypointExtension'=>'.php', 157 'notfoundAct'=>'jelix~notfound' 166 'notfoundAct'=>'jelix~notfound', 167 'simple_urlengine_https'=>'unittest~urlsig_url8@classic @xmlrpc', 158 168 ); 159 169 … … 207 217 $urlList[]= array('urlsig_url2', array('mois'=>'05', 'annee'=>'2004')); 208 218 $urlList[]= array('unittest~urlsig_url3', array('rubrique'=>'actualite', 'id_art'=>'65', 'article'=>'c\'est la f� au village')); 219 $urlList[]= array('unittest~urlsig_url6', array('rubrique'=>'actualite', 'id_art'=>'65')); 209 220 $urlList[]= array('unittest~urlsig_url4', array('first'=>'premier', 'second'=>'deuxieme')); 210 221 // celle ci n'a pas de d�nition dans urls.xml *expr� … … 212 223 $urlList[]= array('jelix~bar@xmlrpc', array('aaa'=>'bbb')); 213 224 $urlList[]= array('news~bar', array('aaa'=>'bbb')); 225 $urlList[]= array('unittest~urlsig_url8', array('rubrique'=>'vetements', 'id_article'=>'98')); 214 226 215 227 $trueResult=array( … … 217 229 "/testnews.php/2004/05", 218 230 "/index.php/test/cms/actualite/65-c-est-la-fete-au-village", 231 "/test/cms2/actualite/65", 219 232 "/foo/bar.php/withhandler/premier/deuxieme", 220 233 "/index.php?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 221 234 "/xmlrpc.php", 222 "/news.php?aaa=bbb&action=default_bar" 223 ); 224 235 "/news.php?aaa=bbb&action=default_bar", 236 "/index.php/shop/vetements/98" 237 238 ); 239 240 $trueResult[8]='https://'.$_SERVER['HTTP_HOST'].$trueResult[8]; 225 241 $this->_doCompareUrl("significant, multiview = false", $urlList,$trueResult); 226 242 … … 231 247 "/testnews/2004/05", 232 248 "/index/test/cms/actualite/65-c-est-la-fete-au-village", 249 "/test/cms2/actualite/65", 233 250 "/foo/bar/withhandler/premier/deuxieme", 234 251 "/index?foo=oof&bar=rab&module=unittest&action=urlsig_url5", 235 252 "/xmlrpc", 236 "/news?aaa=bbb&action=default_bar" 237 ); 253 "/news?aaa=bbb&action=default_bar", 254 "/index/shop/vetements/98" 255 ); 256 $trueResult[8]='https://'.$_SERVER['HTTP_HOST'].$trueResult[8]; 238 257 $this->_doCompareUrl("significant, multiview = true", $urlList,$trueResult); 239 258 trunk/testapp/var/config/defaultconfig.ini.php.dist
r263 r267 76 76 IISStripslashesPathKey = on 77 77 78 ; liste des actions requerant https (syntaxe expliqu�dessous), pour le moteur d'url simple 79 simple_urlengine_https = "unittest~urlsig_url8@classic @xmlrpc" 78 80 79 81 [simple_urlengine_entrypoints] … … 94 96 news = "new~*@classic" 95 97 98 __https= 99 96 100 [logfiles] 97 101 default=messages.log trunk/testapp/var/config/urls.xml
r98 r267 20 20 </url> 21 21 22 <url pathinfo="/test/cms2/:rubrique/:id_art" module="unittest" action="urlsig_url6" noentrypoint="true"> 23 <param name="rubrique" /> 24 <param name="id_art" regexp="\d+"/> 25 </url> 26 27 <url pathinfo="/shop/:rubrique/:id_article" module="unittest" https="true" action="urlsig_url8"> 28 <param name="rubrique" /> 29 <param name="id_article" type="int"/> 30 </url> 22 31 </classicentrypoint> 23 32 <classicentrypoint name="testnews">
