Changeset 53

Show
Ignore:
Timestamp:
01/26/06 01:37:09 (3 years ago)
Author:
laurentj
Message:

travail sur le moteur d'url signif

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix-scripts/templates/config.classic.ini.php.tpl

    r51 r53  
    5858multiview_on = off 
    5959 
     60; chemin url jusqu'au repertoire www (celui que vous tapez dans le navigateur pour acc�r �ndex.php etc.) 
     61; peut �e �le �/" si vous sp�fiez www comme �nt le documentRoot de votre site au niveau du serveur 
     62basepath = "/{$appname}/www" 
     63 
    6064default_entrypoint= index 
    6165 
  • trunk/lib/jelix/core/jDefaultConfig.lib.php

    r51 r53  
    7070    'entrypoint_extension' => '.php', 
    7171    'engine' => 'simple', 
     72    'basepath'=>'', 
    7273    'enable_parser' => '1', 
    7374    'multiview_on' => '', 
  • trunk/lib/jelix/core/response/jResponseHtml.class.php

    r44 r53  
    3939     * le contenu du template principal concerne le contenu de <body> 
    4040     */ 
    41         public $bodyTpl = 'myapp~main'; 
     41    public $bodyTpl = ''; 
    4242 
    4343    /** 
    4444     * template principal �fficher en cas d'erreur 
    4545     */ 
    46     public $bodyErrorTpl = 'myapp~error'; 
     46    public $bodyErrorTpl = ''; 
    4747 
    4848    /** 
     
    122122        $this->_headSent = true; 
    123123        echo implode("\n",$this->_bodyTop); 
    124         $this->body->display($this->bodyTpl); 
     124        if($this->bodyTpl != '') 
     125           $this->body->display($this->bodyTpl); 
    125126 
    126127        if(count($this->_errorMessages)){ 
  • trunk/lib/jelix/core/url/jUrlCompiler.significant.class.php

    r52 r53  
    3939        <urls> 
    4040         <classicentrypoint name="index" default="true"> 
    41             <url path="/test/:mois/:annee" module="" action=""> 
    42                   <var name="mois" escape="true" regexp="\d{4}"/> 
    43                   <var name="annee" escape="false" /> 
    44                   <staticvar name="bla" value="cequejeveux" /> 
     41            <url pathinfo="/test/:mois/:annee" module="" action=""> 
     42                  <param name="mois" escape="true" regexp="\d{4}"/> 
     43                  <param name="annee" escape="false" /> 
     44                  <static name="bla" value="cequejeveux" /> 
    4545            </url> 
    4646            <url handler="" module="" action=""  /> 
     
    123123               $listparam=array(); 
    124124               $escapes = array(); 
    125                if(isset($url['path'])){ 
    126                   $path = (string)$url['path']; 
     125               if(isset($url['pathinfo'])){ 
     126                  $path = (string)$url['pathinfo']; 
    127127                  $regexppath = $path; 
    128128 
     
    130130                      $listparam=$m[1]; 
    131131 
    132                       foreach($url->var as $var){ 
     132                      foreach($url->param as $var){ 
    133133 
    134134                        $nom = (string) $var['name']; 
     
    151151                        } 
    152152 
    153                         $regexppath = str_replace(':'.$name, $regexp, $regexppath); 
     153                        $regexppath = str_replace(':'.$nom, $regexp, $regexppath); 
    154154                      } 
    155155                  } 
     
    159159               } 
    160160               $liststatics = array(); 
    161                foreach($url->staticvar as $var){ 
     161               foreach($url->static as $var){ 
    162162                  $liststatics[(string)$var['name']] =(string)$var['value']; 
    163163               } 
  • trunk/lib/jelix/core/url/jUrlEngine.significant.class.php

    r51 r53  
    5151         $sel = new jSelectorUrlCfgSig('urls.xml'); 
    5252         jIncluder::inc($sel); 
    53          require_once(JELIX_APP_TEMP_PATH.'compiled/urlsig/'.rawurlencode($scriptNamePath).'.entrypoint.php'); 
    54          $this->dataCreateUrl = & $GLOBALS['SIGNIFICANT_CREATEURL']; 
    55          $this->dataParseUrl = & $GLOBALS['SIGNIFICANT_PARSEURL']; 
    56  
    57          if(!$this->_parse($url)){ 
    58             $url= new jUrl($scriptNamePath, $params, $pathinfo); 
     53         $basepath = $GLOBALS['gJConfig']->urlengine['basepath']; 
     54         if(strpos($scriptNamePath, $basepath) === 0){ 
     55            $snp = substr($scriptNamePath,strlen($basepath)); 
     56         }else{ 
     57            $snp = $scriptNamePath; 
     58         } 
     59         $file=JELIX_APP_TEMP_PATH.'compiled/urlsig/'.rawurlencode($snp).'.entrypoint.php'; 
     60         if(file_exists($file)){ 
     61            require_once($file); 
     62            $this->dataCreateUrl = & $GLOBALS['SIGNIFICANT_CREATEURL']; 
     63            $this->dataParseUrl = & $GLOBALS['SIGNIFICANT_PARSEURL']; 
     64 
     65            if(!$this->_parse($url)){ 
     66               // $url peut avoir � modifi�ar _parse, on remet l'ancien 
     67               $url= new jUrl($scriptNamePath, $params, $pathinfo); 
     68            } 
    5969         } 
    6070      } 
     
    151161      */ 
    152162 
    153       $module = $url->getParam ('module', jContext::get()); 
     163      $module = $url->getParam('module', jContext::get()); 
    154164      $action = $url->getParam('action'); 
    155165 
     
    197207            foreach ($urlinfo[2] as $k=>$param){ 
    198208               if($urlinfo[3][$k]){ 
    199                   $result=str_replace('%'.($k+1), jUrl::escape($url->getParam($param,''),true), $result); 
     209                  $result=str_replace(':'.$param, jUrl::escape($url->getParam($param,''),true), $result); 
    200210               }else{ 
    201                   $result=str_replace('%'.($k+1), $url->getParam($param,''), $result); 
     211                  $result=str_replace(':'.$param, $url->getParam($param,''), $result); 
    202212               } 
    203213               $url->delParam($param); 
  • trunk/lib/jelix/CREDITS

    r31 r53  
    77Laurent Jouanneau : Concepteur et d�loppeur principal du code original �elix 
    88 
    9 Gerald Croes et Laurent Jouanneau : principaux contributeurs �ertaines 
     9Gerald Croes et Laurent Jouanneau : principaux contributeurs aux 
    1010parties du code qui sont issues du projet Copix 2.3dev20050901 et qui sont 
    1111sous copyright 2001-2005 Copix Team (http://www.copix.org) 
     
    1414------------- 
    1515 
    16 Gildas Givaja (Giviz) : testeur, corrections de bugs de syntaxe 
    17 Olivier Gambier (d-m-p) : reviewer de code, corrections de bugs de syntaxe 
    18 Loic Mathaud (bballizlife) : corrections orthographiques dans la documentation 
     16Gildas Givaja (Giviz) : testeur, corrections de bugs 
     17Loic Mathaud (bballizlife) : testeur, corrections de bugs, corrections orthographiques dans la documentation 
     18Olivier Gambier (d-m-p) : review de code, corrections de bugs 
  • trunk/myapp/var/config/config.classic.ini.php.dist

    r51 r53  
    5757multiview_on = off 
    5858 
     59; chemin url jusqu'au repertoire www (celui que vous tapez dans le navigateur pour acc�r �ndex.php etc.) 
     60; peut �e �le �/" si vous sp�fiez www comme �nt le documentRoot de votre site au niveau du serveur 
     61basepath = "/myapp/www/" 
     62 
    5963default_entrypoint= index 
    6064 
  • trunk/testapp/var/config/config.classic.ini.php.dist

    r51 r53  
    5757multiview_on = off 
    5858 
     59; chemin url jusqu'au repertoire www (celui que vous tapez dans le navigateur pour acc�r �ndex.php etc.) 
     60; peut �e �le �/" si vous sp�fiez www comme �nt le documentRoot de votre site au niveau du serveur 
     61basepath = "/testapp/www/" 
     62 
    5963default_entrypoint= index 
    6064 
  • trunk/testapp/var/config/urls.xml

    r50 r53  
    22<urls xmlns="http://jelix.org/ns/urls/1.0"> 
    33    <classicentrypoint name="index" default="true"> 
    4         <url path="/test/:mois/:annee" module="testapp" action="test1"> 
    5               <var name="mois" escape="true" regexp="\d{4}"/> 
    6               <var name="annee" escape="false" /> 
    7               <staticvar name="bla" value="cequejeveux" /> 
     4       <url pathinfo="/test/:annee/:mois" module="testapp" action="test1"> 
     5              <param name="annee" escape="true" regexp="\d{4}"/> 
     6              <param name="mois" escape="false" /> 
     7              <static name="bla" value="cequejeveux" /> 
    88        </url> 
    9         <url handler="foo" module="testapp" action="withhandler"  /
     9        <!--<url handler="foo" module="testapp"  />--
    1010    </classicentrypoint> 
    1111    <classicentrypoint name="news"> 
     
    1414    <xmlrpcentrypoint name="xmlrpc" default="true" /> 
    1515    <jsonrpcentrypoint name="jsonrpc" default="true" /> 
    16      
     16 
    1717</urls> 
Download in other formats: Unified Diff Zip Archive