developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #503: ticket_503_v2.diff

File ticket_503_v2.diff, 13.1 KB (added by laurentj, 12 years ago)

version 2 du patch

  • build/buildjelix.php

     
    22/**
    33* @package     jelix
    44* @author      Jouanneau Laurent
    5 * @contributor
    6 * @copyright   2006-2007 Jouanneau laurent
     5* @contributor Kévin Lepeltier
     6* @copyright   2006-2008 Jouanneau laurent
     7* @copyright   2008 Kévin Lepeltier
    78* @link        http://www.jelix.org
    89* @licence     GNU General Public Licence see LICENCE file or http://www.gnu.org/licenses/gpl.html
    910*/
     
    7576    "True if you want to include lib/fonts content for tcpdf or other",
    7677    false,
    7778    ),
     79'PROPERTIES_CHARSET_TARGET'=> array(
     80    "List of charset used for command cch (convert charset)",
     81    'UTF-8,ISO-8859-1,ISO-8859-15',
     82    '',
     83    ),
     84'DEFAULT_CHARSET'=> array(
     85    "The default charset of file. useful when convertir some files (cch command)",
     86    'UTF-8',
     87    '',
     88    ),
    7889'PHP50'=> array(
    7990    false,   // hidden option
    8091    false,
  • build/manifests/jelix-lib.mn

     
    115115  install_jsession.schema.pgsql.sql
    116116
    117117cd lib/jelix/core-modules/jelix/locales/en_US
    118   acl2db.ISO-8859-1.properties
    119   acl2db.ISO-8859-15.properties
    120   acl2db.UTF-8.properties
    121   acldb.ISO-8859-1.properties
    122   acldb.ISO-8859-15.properties
    123   acldb.UTF-8.properties
    124   auth.ISO-8859-1.properties
    125   auth.ISO-8859-15.properties
    126   auth.UTF-8.properties
    127   captcha.ISO-8859-1.properties
    128   captcha.ISO-8859-15.properties
    129   captcha.UTF-8.properties
    130   common.ISO-8859-1.properties
    131   common.ISO-8859-15.properties
    132   common.UTF-8.properties
    133   crud.ISO-8859-1.properties
    134   crud.ISO-8859-15.properties
    135   crud.UTF-8.properties
    136   dao.ISO-8859-1.properties
    137   dao.ISO-8859-15.properties
    138   dao.UTF-8.properties
    139   daoxml.ISO-8859-1.properties
    140   daoxml.ISO-8859-15.properties
    141   daoxml.UTF-8.properties
    142   db.ISO-8859-1.properties
    143   db.ISO-8859-15.properties
    144   db.UTF-8.properties
    145   errors.ISO-8859-1.properties
    146   errors.ISO-8859-15.properties
    147   errors.UTF-8.properties
    148   format.ISO-8859-1.properties
    149   format.ISO-8859-15.properties
    150   format.UTF-8.properties
    151   formserr.ISO-8859-1.properties
    152   formserr.ISO-8859-15.properties
    153   formserr.UTF-8.properties
    154   jelix.ISO-8859-1.properties
    155   jelix.ISO-8859-15.properties
    156   jelix.UTF-8.properties
    157   ui.ISO-8859-1.properties
    158   ui.ISO-8859-15.properties
    159   ui.UTF-8.properties
     118cch acl2db.UTF-8.properties(acl2db.%charset%.properties)
     119cch acldb.UTF-8.properties(acldb.%charset%.properties)
     120cch auth.UTF-8.properties(auth.%charset%.properties)
     121cch captcha.UTF-8.properties(captcha.%charset%.properties)
     122cch common.UTF-8.properties(common.%charset%.properties)
     123cch crud.UTF-8.properties(crud.%charset%.properties)
     124cch dao.UTF-8.properties(dao.%charset%.properties)
     125cch daoxml.UTF-8.properties(daoxml.%charset%.properties)
     126cch db.UTF-8.properties(db.%charset%.properties)
     127cch errors.UTF-8.properties(errors.%charset%.properties)
     128cch format.UTF-8.properties(format.%charset%.properties)
     129cch formserr.UTF-8.properties(formserr.%charset%.properties)
     130cch jelix.UTF-8.properties(jelix.%charset%.properties)
     131cch ui.UTF-8.properties(ui.%charset%.properties)
    160132cd lib/jelix/core-modules/jelix/locales/en_EN
    161   acl2db.ISO-8859-1.properties
    162   acl2db.ISO-8859-15.properties
    163   acl2db.UTF-8.properties
    164   acldb.ISO-8859-1.properties
    165   acldb.ISO-8859-15.properties
    166   acldb.UTF-8.properties
    167   auth.ISO-8859-1.properties
    168   auth.ISO-8859-15.properties
    169   auth.UTF-8.properties
    170   captcha.ISO-8859-1.properties
    171   captcha.ISO-8859-15.properties
    172   captcha.UTF-8.properties
    173   common.ISO-8859-1.properties
    174   common.ISO-8859-15.properties
    175   common.UTF-8.properties
    176   crud.ISO-8859-1.properties
    177   crud.ISO-8859-15.properties
    178   crud.UTF-8.properties
    179   dao.ISO-8859-1.properties
    180   dao.ISO-8859-15.properties
    181   dao.UTF-8.properties
    182   daoxml.ISO-8859-1.properties
    183   daoxml.ISO-8859-15.properties
    184   daoxml.UTF-8.properties
    185   db.ISO-8859-1.properties
    186   db.ISO-8859-15.properties
    187   db.UTF-8.properties
    188   errors.ISO-8859-1.properties
    189   errors.ISO-8859-15.properties
    190   errors.UTF-8.properties
    191   format.ISO-8859-1.properties
    192   format.ISO-8859-15.properties
    193   format.UTF-8.properties
    194   formserr.ISO-8859-1.properties
    195   formserr.ISO-8859-15.properties
    196   formserr.UTF-8.properties
    197   jelix.ISO-8859-1.properties
    198   jelix.ISO-8859-15.properties
    199   jelix.UTF-8.properties
    200   ui.ISO-8859-1.properties
    201   ui.ISO-8859-15.properties
    202   ui.UTF-8.properties
     133cch acl2db.UTF-8.properties(acl2db.%charset%.properties)
     134cch acldb.UTF-8.properties(acldb.%charset%.properties)
     135cch auth.UTF-8.properties(auth.%charset%.properties)
     136cch captcha.UTF-8.properties(captcha.%charset%.properties)
     137cch common.UTF-8.properties(common.%charset%.properties)
     138cch crud.UTF-8.properties(crud.%charset%.properties)
     139cch dao.UTF-8.properties(dao.%charset%.properties)
     140cch daoxml.UTF-8.properties(daoxml.%charset%.properties)
     141cch db.UTF-8.properties(db.%charset%.properties)
     142cch errors.UTF-8.properties(errors.%charset%.properties)
     143cch format.UTF-8.properties(format.%charset%.properties)
     144cch formserr.UTF-8.properties(formserr.%charset%.properties)
     145cch jelix.UTF-8.properties(jelix.%charset%.properties)
     146cch ui.UTF-8.properties(ui.%charset%.properties)
    203147cd lib/jelix/core-modules/jelix/locales/fr_FR
    204   acl2db.ISO-8859-1.properties
    205   acl2db.ISO-8859-15.properties
    206   acl2db.UTF-8.properties
    207   acldb.ISO-8859-1.properties
    208   acldb.ISO-8859-15.properties
    209   acldb.UTF-8.properties
    210   auth.ISO-8859-1.properties
    211   auth.ISO-8859-15.properties
    212   auth.UTF-8.properties
    213   captcha.ISO-8859-1.properties
    214   captcha.ISO-8859-15.properties
    215   captcha.UTF-8.properties
    216   common.ISO-8859-1.properties
    217   common.ISO-8859-15.properties
    218   common.UTF-8.properties
    219   crud.ISO-8859-1.properties
    220   crud.ISO-8859-15.properties
    221   crud.UTF-8.properties
    222   dao.ISO-8859-1.properties
    223   dao.ISO-8859-15.properties
    224   dao.UTF-8.properties
    225   daoxml.ISO-8859-1.properties
    226   daoxml.ISO-8859-15.properties
    227   daoxml.UTF-8.properties
    228   db.ISO-8859-1.properties
    229   db.ISO-8859-15.properties
    230   db.UTF-8.properties
    231   errors.ISO-8859-1.properties
    232   errors.ISO-8859-15.properties
    233   errors.UTF-8.properties
    234   format.ISO-8859-1.properties
    235   format.ISO-8859-15.properties
    236   format.UTF-8.properties
    237   formserr.ISO-8859-1.properties
    238   formserr.ISO-8859-15.properties
    239   formserr.UTF-8.properties
    240   jelix.ISO-8859-1.properties
    241   jelix.ISO-8859-15.properties
    242   jelix.UTF-8.properties
    243   ui.ISO-8859-1.properties
    244   ui.ISO-8859-15.properties
    245   ui.UTF-8.properties
     148cch acl2db.UTF-8.properties(acl2db.%charset%.properties)
     149cch acldb.UTF-8.properties(acldb.%charset%.properties)
     150cch auth.UTF-8.properties(auth.%charset%.properties)
     151cch captcha.UTF-8.properties(captcha.%charset%.properties)
     152cch common.UTF-8.properties(common.%charset%.properties)
     153cch crud.UTF-8.properties(crud.%charset%.properties)
     154cch dao.UTF-8.properties(dao.%charset%.properties)
     155cch daoxml.UTF-8.properties(daoxml.%charset%.properties)
     156cch db.UTF-8.properties(db.%charset%.properties)
     157cch errors.UTF-8.properties(errors.%charset%.properties)
     158cch format.UTF-8.properties(format.%charset%.properties)
     159cch formserr.UTF-8.properties(formserr.%charset%.properties)
     160cch jelix.UTF-8.properties(jelix.%charset%.properties)
     161cch ui.UTF-8.properties(ui.%charset%.properties)
    246162cd lib/jelix/core-modules/jelix/templates
    247163  404.xul.tpl
    248164  403.html.tpl
     
    360276  auth.coord.ini.php
    361277  authsw.coord.ini.php
    362278cd lib/jelix-modules/jauth/locales/en_US
    363   auth.ISO-8859-1.properties
    364   auth.ISO-8859-15.properties
    365   auth.UTF-8.properties
    366   autherror.ISO-8859-1.properties
    367   autherror.ISO-8859-15.properties
    368   autherror.UTF-8.properties
     279cch auth.UTF-8.properties(auth.%charset%.properties)
     280cch autherror.UTF-8.properties(autherror.%charset%.properties)
    369281cd lib/jelix-modules/jauth/locales/en_EN
    370   auth.ISO-8859-1.properties
    371   auth.ISO-8859-15.properties
    372   auth.UTF-8.properties
    373   autherror.ISO-8859-1.properties
    374   autherror.ISO-8859-15.properties
    375   autherror.UTF-8.properties
     282cch auth.UTF-8.properties(auth.%charset%.properties)
     283cch autherror.UTF-8.properties(autherror.%charset%.properties)
    376284cd lib/jelix-modules/jauth/locales/fr_FR
    377   auth.ISO-8859-1.properties
    378   auth.ISO-8859-15.properties
    379   auth.UTF-8.properties
    380   autherror.ISO-8859-1.properties
    381   autherror.ISO-8859-15.properties
    382   autherror.UTF-8.properties
     285cch auth.UTF-8.properties(auth.%charset%.properties)
     286cch autherror.UTF-8.properties(autherror.%charset%.properties)
    383287cd lib/jelix-modules/jauth/templates
    384288  login.form.tpl
    385289  index.tpl
     
    393297cd lib/jelix-modules/jWSDL/templates
    394298  soap_doc.tpl
    395299cd lib/jelix-modules/jWSDL/locales/en_EN
    396   errors.ISO-8859-1.properties
    397   errors.UTF-8.properties
     300cch errors.UTF-8.properties(errors.%charset%.properties)
    398301cd lib/jelix-modules/jWSDL/locales/en_US
    399   errors.ISO-8859-1.properties
    400   errors.UTF-8.properties
     302cch errors.UTF-8.properties(errors.%charset%.properties)
    401303cd lib/jelix-modules/jWSDL/locales/fr_FR
    402   errors.ISO-8859-1.properties
    403   errors.UTF-8.properties
     304cch errors.UTF-8.properties(errors.%charset%.properties)
    404305
    405306cd lib/jelix-plugins
    406307  LICENCE
  • build/CREDITS

     
    33
    44Main developer : Laurent Jouanneau
    55
    6 See http://jelix.org
     6Contributors:
    77
     8Kévin Lepeltier (aka Lipki)
     9  - convertion of file to other encoding (cch command in manifests)
    810
     11
    912Credits for external tools including in the package
    1013===================================================
    1114
  • build/lib/jManifest.class.php

     
    11<?php
    22/**
    33* @package     jBuildTools
    4 * @author      Jouanneau Laurent
    5 * @contributor
    6 * @copyright   2006 Jouanneau laurent
     4* @author      Laurent Jouanneau
     5* @contributor Kévin Lepeltier
     6* @copyright   2006-2008 Jouanneau laurent
     7* @copyright   2008 Kévin Lepeltier
    78* @link        http://www.jelix.org
    89* @licence     GNU General Public Licence see LICENCE file or http://www.gnu.org/licenses/gpl.html
    910*/
     
    3334
    3435        foreach($script as $nbline=>$line){
    3536            $nbline++;
    36             if(preg_match(';^(cd|sd|dd|\*|!|\*!|c|\*c)?\s+([a-zA-Z0-9\/.\-_]+)\s*(?:\(([a-zA-Z0-9\/.\-_]*)\))?\s*$;m', $line, $m)){
     37            if(preg_match(';^(cd|sd|dd|\*|!|\*!|c|\*c|cch)?\s+([a-zA-Z0-9\/.\-_]+)\s*(?:\(([a-zA-Z0-9\%\/.\-_]*)\))?\s*$;m', $line, $m)){
    3738                if($m[1] == 'dd'){
    3839                    $currentdestdir = jBuildUtils::normalizeDir($m[2]);
    3940                    jBuildUtils::createDir($distdir.$currentdestdir);
     
    4546                    jBuildUtils::createDir($distdir.$currentdestdir);
    4647                }else{
    4748                    $doPreprocessing = (strpos($m[1],'*') !== false);
    48                     $doCompression = (strpos($m[1],'c') !== false) || ($stripcomment && (strpos($m[1],'!') === false));
     49                    $doCompression = (strpos($m[1],'c') !== false && $m[1] != 'cch') || ($stripcomment && (strpos($m[1],'!') === false));
    4950
    5051                    if($m[2] == ''){
    5152                        throw new Exception ( "$ficlist : file required on line $nbline \n");
     
    9091                        $script = file_get_contents($sourcefile);
    9192                        $packer = new JavaScriptPacker($script, 0, true, false);
    9293                        file_put_contents($destfile, $packer->pack());
     94
     95                    }elseif($m[1] == 'cch') {
     96                        if(strpos($m[3], '%charset%') === false) {
     97                            throw new Exception ( "$ficlist : line $nbline, dest file ".$m[3]." doesn't contains %charset% pattern.\n");
     98                        }
     99
     100                        if($verbose)
     101                            echo "convert charset\tsources\t".$sourcedir.$currentsrcdir.$m[2]."   ".$m[3]."\n";
     102
     103                        $encoding = preg_split('/[\s,]+/', $preprocvars['PROPERTIES_CHARSET_TARGET']);
     104
     105                        $content = file_get_contents( $sourcefile );
     106                        if (isset($preprocvars['DEFAULT_CHARSET']) && $preprocvars['DEFAULT_CHARSET'] != '')
     107                            $encode = $preprocvars['DEFAULT_CHARSET'];
     108                        else
     109                            $encode = mb_detect_encoding( $content );
     110
     111                        foreach ( $encoding as $val ) {
     112                            $encodefile = str_replace('%charset%', $val, $destfile);
     113                            if($verbose)
     114                                echo "\tencode into ".$encodefile."\n";
     115                            $file = fopen($encodefile, "w");
     116                            fwrite($file, mb_convert_encoding($content, $val, $encode));
     117                            fclose($file);
     118                        }
     119
    93120                    }else{
    94121                        if($verbose)
    95122                            echo "copy  ".$sourcedir.$currentsrcdir.$m[2]."\tto\t".$destfile."\n";