Changeset 7087

Show
Ignore:
Timestamp:
11/26/08 02:30:30 (6 weeks ago)
Author:
inureyes
Message:

refs #1156

  • DB bind시 변수 저장을 초기화하여 DB의 charset을 제대로 인식하지 못하는 문제 수정
Location:
trunk/library
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/library/components/Needlworks.DBMS.MySQLi.php

    r6534 r7087  
    1414        // Connects DB and set environment variables 
    1515        // $database array should contain 'server','username','password'. 
     16        self::$cachedResult = self::$dbProperties = array(); 
    1617        if(!isset($database) || empty($database)) return false; 
    1718        if(!isset($database['port']) && strpos($database['server'],':')) { 
     
    3334            self::$dbProperties['charset'] = 'default'; 
    3435        @self::query('SET SESSION collation_connection = \'utf8_general_ci\''); 
    35         self::$cachedResult = self::$dbProperties = array(); 
    3636        return true; 
    3737    } 
  • trunk/library/components/Needlworks.PHP.Core.php

    r6533 r7087  
    254254    **/ 
    255255 
    256  
     256    private static $queue; 
     257     
     258    static function addRule($iv) { 
     259        if(empty(self::$queue)) self::$queue = array('GET'=>array(),'POST'=>array(),'REQUEST'=>array(),'SERVER'=>array(),'FILES'=>array()); 
     260        if(isset($iv['GET'])) self::$queue['GET'] = array_merge(self::$queue['GET'],$iv['GET']); 
     261        if(isset($iv['POST'])) self::$queue['POST'] = array_merge(self::$queue['POST'],$iv['POST']); 
     262        if(isset($iv['REQUEST'])) self::$queue['REQUEST'] = array_merge(self::$queue['REQUEST'],$iv['REQUEST']); 
     263        if(isset($iv['SERVER'])) self::$queue['SERVER'] = array_merge(self::$queue['SERVER'],$iv['SERVER']); 
     264        if(isset($iv['FILES'])) self::$queue['FILES'] = array_merge(self::$queue['FILES'],$iv['FILES']); 
     265    } 
     266    static function isValid() { 
     267        return self::validate(self::$queue); 
     268    } 
     269     
    257270    static function validate(&$iv) { 
    258271        if (isset($iv['GET'])) { 
  • trunk/library/components/Textcube.Data.Config.php

    r7075 r7087  
    4040         
    4141        // Database setting. 
    42 //      if(isset($service['dbms'])) { 
    43 //          if($service['dbms'] == 'mysql' && class_exists('mysqli')) $service['dbms'] = 'mysqli'; 
    44 //      } 
    45          
    46         // Debug mode configuration. 
    47         if($service['debugmode'] == true) { 
    48             if(isset($service['dbms'])) { 
    49                 switch($service['dbms']) { 
    50                     case 'mysqli':         require_once(ROOT. "/library/components/Needlworks.Debug.MySQLi.php"); break; 
    51                     case 'mysql': default: require_once(ROOT. "/library/components/Needlworks.Debug.MySQL.php"); break; 
    52                 } 
    53             } else require_once(ROOT. "/library/components/Needlworks.Debug.MySQL.php"); 
     42        if(isset($service['dbms'])) { 
     43            if($service['dbms'] == 'mysql' && class_exists('mysqli')) $service['dbms'] = 'mysqli'; 
    5444        } 
    5545         
  • trunk/library/preprocessor.php

    r7072 r7087  
    44/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) 
    55 
    6 /** Dispatcher 
     6/** Pre-processor - This file  
    77    ---------- 
     8     
    89*/ 
    910/** Loading Basic Components */ 
     
    2728); 
    2829Validator::validateArray($_SERVER, $basicIV); 
     30/** Basic URI information validation. */ 
    2931if(isset($URLInfo)) { 
    3032    $basicIV = array( 
     
    4648 
    4749/** Loading debug module */ 
    48  
     50if($config->service['debugmode'] == true) { 
     51    if(isset($config->service['dbms'])) { 
     52        switch($config->service['dbms']) { 
     53            case 'mysqli':         require_once(ROOT. "/library/components/Needlworks.Debug.MySQLi.php");break; 
     54            case 'mysql': default: require_once(ROOT. "/library/components/Needlworks.Debug.MySQL.php"); break; 
     55        } 
     56    } else require_once(ROOT. "/library/components/Needlworks.Debug.MySQL.php"); 
     57} 
     58     
    4959/** Loading components / models / views */ 
    5060require_once (ROOT.'/library/include.'.$context->URLInfo['interfaceType'].'.php');