Changeset 105

Show
Ignore:
Timestamp:
03/11/06 13:02:11 (3 years ago)
Author:
laurentj
Message:

debut travail sur une version standalone de jtpl

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/jelix/core/jSelector.class.php

    r101 r105  
    306306    function __construct($sel){ 
    307307        $this->_compiler='jTplCompiler'; 
    308         $this->_compilerPath=JELIX_LIB_UTILS_PATH.'jTplCompiler.class.php'; 
     308        $this->_compilerPath=JELIX_LIB_TPL_PATH.'jTplCompiler.class.php'; 
    309309        parent::__construct($sel); 
    310310    } 
  • trunk/lib/jelix/tpl/jTpl.class.php

    r104 r105  
    22/** 
    33* @package     jelix 
    4 * @subpackage  utils 
     4* @subpackage  jtpl 
    55* @version     $Id$ 
    66* @author      Jouanneau Laurent 
     
    4444        } 
    4545    } 
    46  
     46#ifndef JTPL_STANDALONE 
    4747    function assignZone($name, $zoneName, $params=array()){ 
    4848        $this->_vars[$name] = jZone::processZone ($zoneName, $params); 
    4949    } 
     50#endif 
    5051    /* 
    5152    function assignStatic($varName, $select){ 
  • trunk/lib/jelix/tpl/jTplCompiler.class.php

    r104 r105  
    22/** 
    33* @package     jelix 
    4 * @subpackage  core 
     4* @subpackage  jtpl 
    55* @version     $Id$ 
    66* @author      Jouanneau Laurent 
    7 * @contributor 
     7* @contributor Mathaud Loic (version standalone) 
    88* @copyright   2005-2006 Jouanneau laurent 
     9* @copyright   2006 Mathaud Loic 
    910* @link        http://www.jelix.org 
    1011* @licence     GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html 
    1112*/ 
    1213 
    13  
    14 class jTplCompiler implements jISimpleCompiler { 
    15  
     14class jTplCompiler 
     15#ifndef JTPL_STANDALONE 
     16    implements jISimpleCompiler { 
     17#else 
     18    { 
     19 
     20    private $_locales; 
     21#endif 
    1622    private $_literals; 
    1723 
     
    4854       $this->_allowedInExpr = array_merge($this->_vartype, $this->_op); 
    4955       $this->_allowedAssign = array_merge($this->_vartype, $this->_assignOp, $this->_op); 
    50     } 
    51  
     56#ifdef JTPL_STANDALONE 
     57       require_once(JTPL_LOCALES_PATH.$GLOBALS['jTplConfig']['lang'].'.php'); 
     58       $this->_locales = $GLOBALS['jTplConfig']['locales']; 
     59#endif 
     60    } 
     61 
     62#ifdef JTPL_STANDALONE 
     63   public function compile($tplFile){ 
     64      $this->_sourceFile = $tplFile; 
     65      $cachefile = JTPL_CACHE_PATH . basename($tplFile); 
     66 
     67#else 
    5268    public function compile($selector){ 
    5369 
     
    5672 
    5773        jContext::push($selector->module); 
     74#endif 
    5875 
    5976        if(!file_exists($this->_sourceFile)){ 
     77#ifdef JTPL_STANDALONE 
     78            trigger_error(sprintf($this->_locales['errors.tpl.not.found'], $this->_sourceFile), E_USER_ERROR); 
     79#else 
    6080            trigger_error(jLocale::get('jelix~errors.tpl.not.found',array($this->_sourceFile)),E_USER_ERROR); 
     81#endif 
    6182        } 
    6283 
  • trunk/Makefile

    r89 r105  
    1717DISTJELIX="$(DIST)/jelix-$(LIB_VERSION)" 
    1818DISTHACKER="$(DIST)/jelix-svn" 
    19  
     19DISTJTPL="$(DIST)/jtpl" 
    2020 
    2121default: 
    22         @echo "target:  dist-all dist-jelix dist-testapp dist-myapp dev-all dev-jelix dev-myapp dev-testapp
     22        @echo "target:  dist-all dist-jelix dist-testapp dist-myapp dev-all dev-jelix dev-myapp dev-testapp jtpl
    2323 
    24 dist-all: dist-jelix dist-testapp dist-myapp 
     24dist-all: dist-jelix dist-testapp dist-myapp jtpl 
    2525 
    2626dev-all: dev-jelix dev-myapp dev-testapp 
     
    5858        if [ ! -d "$(DISTJELIX)" ] ; then mkdir $(DISTJELIX) ; fi 
    5959        if [ ! -d "$(DISTHACKER)" ] ; then mkdir $(DISTHACKER) ; fi 
     60        if [ ! -d "$(DISTJTPL)" ] ; then mkdir $(DISTJTPL) ; fi 
    6061         
     62jtpl: common 
     63        export JTPL_STANDALONE=1 \ 
     64        && $(PHP) build/mkdist.php build/manifests/jtpl-standalone.mn . $(DISTJTPL) 
    6165 
Download in other formats: Unified Diff Zip Archive