Changeset 515

Show
Ignore:
Timestamp:
08/01/07 17:11:25 (1 year ago)
Author:
laurentj
Message:

ticket #205: force_encoding parameter has been added in dbprofiles file with a comment
ticket #201: some constant names in jDatetime were not consistent, BD_* are now deprecated and DB_* should be used

Files:

Legend:

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

    r496 r515  
    1919;password= 
    2020;persistent= on 
     21; when you have charset issues, enable force_encoding so the connection will be 
     22; made with the charset indicated in jelix config 
     23;force_encoding = on 
    2124 
    2225; pour pdo : 
  • trunk/lib/jelix-scripts/templates/var/config/dbprofils.ini.php.tpl

    r496 r515  
    1919;password= 
    2020;persistent= on 
     21; when you have charset issues, enable force_encoding so the connection will be 
     22; made with the charset indicated in jelix config 
     23;force_encoding = on 
    2124 
    2225; pour pdo : 
  • trunk/lib/jelix/plugins/tpl/common/modifier.jdatetime.php

    r506 r515  
    2121 * <li>'lang_datetime' => jDateTime::LANG_DTFORMAT)</li> 
    2222 * <li>'lang_time' => jDateTime::LANG_TFORMAT)</li> 
    23  * <li>'db_date' => jDateTime::BD_DFORMAT)</li> 
    24  * <li>'db_datetime' => jDateTime::BD_DTFORMAT)</li> 
    25  * <li>'db_time' => jDateTime::BD_TFORMAT)</li> 
     23 * <li>'db_date' => jDateTime::DB_DFORMAT)</li> 
     24 * <li>'db_datetime' => jDateTime::DB_DTFORMAT)</li> 
     25 * <li>'db_time' => jDateTime::DB_TFORMAT)</li> 
    2626 * <li>'iso8601' => jDateTime::ISO8601_FORMAT)</li> 
    2727 * <li>'timestamp' => jDateTime::TIMESTAMP_FORMAT)</li> 
     
    4444        'lang_datetime' => jDateTime::LANG_DTFORMAT, 
    4545        'lang_time' => jDateTime::LANG_TFORMAT, 
    46         'db_date' => jDateTime::BD_DFORMAT, 
    47         'db_datetime' => jDateTime::BD_DTFORMAT, 
    48         'db_time' => jDateTime::BD_TFORMAT, 
     46        'db_date' => jDateTime::DB_DFORMAT, 
     47        'db_datetime' => jDateTime::DB_DTFORMAT, 
     48        'db_time' => jDateTime::DB_TFORMAT, 
    4949        'iso8601' => jDateTime::ISO8601_FORMAT, 
    5050        'timestamp' => jDateTime::TIMESTAMP_FORMAT, 
  • trunk/lib/jelix/plugins/tpl/common/modifier.jdatetime.php

    r506 r515  
    2121 * <li>'lang_datetime' => jDateTime::LANG_DTFORMAT)</li> 
    2222 * <li>'lang_time' => jDateTime::LANG_TFORMAT)</li> 
    23  * <li>'db_date' => jDateTime::BD_DFORMAT)</li> 
    24  * <li>'db_datetime' => jDateTime::BD_DTFORMAT)</li> 
    25  * <li>'db_time' => jDateTime::BD_TFORMAT)</li> 
     23 * <li>'db_date' => jDateTime::DB_DFORMAT)</li> 
     24 * <li>'db_datetime' => jDateTime::DB_DTFORMAT)</li> 
     25 * <li>'db_time' => jDateTime::DB_TFORMAT)</li> 
    2626 * <li>'iso8601' => jDateTime::ISO8601_FORMAT)</li> 
    2727 * <li>'timestamp' => jDateTime::TIMESTAMP_FORMAT)</li> 
     
    4444        'lang_datetime' => jDateTime::LANG_DTFORMAT, 
    4545        'lang_time' => jDateTime::LANG_TFORMAT, 
    46         'db_date' => jDateTime::BD_DFORMAT, 
    47         'db_datetime' => jDateTime::BD_DTFORMAT, 
    48         'db_time' => jDateTime::BD_TFORMAT, 
     46        'db_date' => jDateTime::DB_DFORMAT, 
     47        'db_datetime' => jDateTime::DB_DTFORMAT, 
     48        'db_time' => jDateTime::DB_TFORMAT, 
    4949        'iso8601' => jDateTime::ISO8601_FORMAT, 
    5050        'timestamp' => jDateTime::TIMESTAMP_FORMAT, 
  • trunk/lib/jelix/utils/jDateTime.class.php

    r440 r515  
    7373    const LANG_DTFORMAT=11; 
    7474    const LANG_TFORMAT=12; 
     75    const DB_DFORMAT=20; 
     76    const DB_DTFORMAT=21; 
     77    const DB_TFORMAT=22; 
     78    const ISO8601_FORMAT=40; 
     79    const TIMESTAMP_FORMAT=50; 
     80    const RFC822_FORMAT=60; 
     81 
     82    /**#@+ 
     83     * use DB_* consts instead 
     84     * @deprecated 
     85     */ 
    7586    const BD_DFORMAT=20; 
    7687    const BD_DTFORMAT=21; 
    7788    const BD_TFORMAT=22; 
    78     const ISO8601_FORMAT=40; 
    79     const TIMESTAMP_FORMAT=50; 
    80     const RFC822_FORMAT=60; 
    81  
     89    /**#@-*/ 
    8290 
    8391    function __construct($year=0, $month=0, $day=0, $hour=0, $minute=0, $second=0){ 
     
    117125               $str = date($lf, $t); 
    118126               break; 
     127           case self::DB_DFORMAT: 
    119128           case self::BD_DFORMAT: 
    120129               $str = sprintf('%04d-%02d-%02d', $this->year, $this->month, $this->day); 
    121130               break; 
     131           case self::DB_DTFORMAT: 
    122132           case self::BD_DTFORMAT: 
    123133               $str = sprintf('%04d-%02d-%02d %02d:%02d:%02d', $this->year, $this->month, $this->day, $this->hour, $this->minute, $this->second); 
    124134               break; 
     135           case self::DB_TFORMAT: 
    125136           case self::BD_TFORMAT: 
    126137               $str = sprintf('%02d:%02d:%02d', $this->hour, $this->minute, $this->second); 
     
    185196               } 
    186197               break; 
     198           case self::DB_DFORMAT: 
    187199           case self::BD_DFORMAT: 
    188200               if($ok=preg_match('/^(\d{4})\-(\d{2})\-(\d{2})$/', $str, $match)){ 
     
    192204               } 
    193205               break; 
     206           case self::DB_DTFORMAT: 
    194207           case self::BD_DTFORMAT: 
    195208               if($ok=preg_match('/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/', $str, $match)){ 
     
    202215               } 
    203216               break; 
     217           case self::DB_TFORMAT: 
    204218           case self::BD_TFORMAT: 
    205219               if($ok=preg_match('/^(\d{2}):(\d{2}):(\d{2})$/', $str, $match)){ 
  • trunk/lib/jelix/utils/jDateTime.class.php

    r440 r515  
    7373    const LANG_DTFORMAT=11; 
    7474    const LANG_TFORMAT=12; 
     75    const DB_DFORMAT=20; 
     76    const DB_DTFORMAT=21; 
     77    const DB_TFORMAT=22; 
     78    const ISO8601_FORMAT=40; 
     79    const TIMESTAMP_FORMAT=50; 
     80    const RFC822_FORMAT=60; 
     81 
     82    /**#@+ 
     83     * use DB_* consts instead 
     84     * @deprecated 
     85     */ 
    7586    const BD_DFORMAT=20; 
    7687    const BD_DTFORMAT=21; 
    7788    const BD_TFORMAT=22; 
    78     const ISO8601_FORMAT=40; 
    79     const TIMESTAMP_FORMAT=50; 
    80     const RFC822_FORMAT=60; 
    81  
     89    /**#@-*/ 
    8290 
    8391    function __construct($year=0, $month=0, $day=0, $hour=0, $minute=0, $second=0){ 
     
    117125               $str = date($lf, $t); 
    118126               break; 
     127           case self::DB_DFORMAT: 
    119128           case self::BD_DFORMAT: 
    120129               $str = sprintf('%04d-%02d-%02d', $this->year, $this->month, $this->day); 
    121130               break; 
     131           case self::DB_DTFORMAT: 
    122132           case self::BD_DTFORMAT: 
    123133               $str = sprintf('%04d-%02d-%02d %02d:%02d:%02d', $this->year, $this->month, $this->day, $this->hour, $this->minute, $this->second); 
    124134               break; 
     135           case self::DB_TFORMAT: 
    125136           case self::BD_TFORMAT: 
    126137               $str = sprintf('%02d:%02d:%02d', $this->hour, $this->minute, $this->second); 
     
    185196               } 
    186197               break; 
     198           case self::DB_DFORMAT: 
    187199           case self::BD_DFORMAT: 
    188200               if($ok=preg_match('/^(\d{4})\-(\d{2})\-(\d{2})$/', $str, $match)){ 
     
    192204               } 
    193205               break; 
     206           case self::DB_DTFORMAT: 
    194207           case self::BD_DTFORMAT: 
    195208               if($ok=preg_match('/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/', $str, $match)){ 
     
    202215               } 
    203216               break; 
     217           case self::DB_TFORMAT: 
    204218           case self::BD_TFORMAT: 
    205219               if($ok=preg_match('/^(\d{2}):(\d{2}):(\d{2})$/', $str, $match)){ 
  • trunk/myapp/var/config/dbprofils.ini.php.dist

    r386 r515  
    1515password= 
    1616persistent= on 
     17; when you have charset issues, enable force_encoding so the connection will be 
     18; made with the charset indicated in jelix config 
     19;force_encoding = on 
    1720 
    1821; pour pdo : 
  • trunk/myapp/var/config/dbprofils.ini.php.dist

    r386 r515  
    1515password= 
    1616persistent= on 
     17; when you have charset issues, enable force_encoding so the connection will be 
     18; made with the charset indicated in jelix config 
     19;force_encoding = on 
    1720 
    1821; pour pdo : 
  • trunk/testapp/var/config/dbprofils.ini.php.dist

    r477 r515  
    2222password= 
    2323persistent= on 
     24; when you have charset issues, enable force_encoding so the connection will be 
     25; made with the charset indicated in jelix config 
     26;force_encoding = on 
    2427 
    2528; to run all test, you should install pdo on your server 
  • trunk/testapp/var/config/dbprofils.ini.php.dist

    r477 r515  
    2222password= 
    2323persistent= on 
     24; when you have charset issues, enable force_encoding so the connection will be 
     25; made with the charset indicated in jelix config 
     26;force_encoding = on 
    2427 
    2528; to run all test, you should install pdo on your server 
Download in other formats: Unified Diff Zip Archive