Changeset 19 for ez_publish/ezipb/trunk

Show
Ignore:
Timestamp:
09/04/07 20:36:10 (16 months ago)
Author:
llaumgui
Message:

Cosmétique

Location:
ez_publish/ezipb/trunk/classes
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • ez_publish/ezipb/trunk/classes/ezipsclass.php

    r3 r19  
    3333class ezipsclass extends ipsclass { 
    3434         
    35         public $ezipbIni; 
    36          
    3735         
    3836         
     
    4240        function init_db_connection() { 
    4341                 
    44                 $_pre_load = $this->memory_debug_make_flag(); 
     42                //$_pre_load = $this->memory_debug_make_flag(); 
    4543                 
    4644                $this->vars['sql_driver'] = ! $this->vars['sql_driver'] ? 'mysql' : strtolower($this->vars['sql_driver']); 
    4745                 
    48                 if ( ! class_exists( 'db_main' ) ) 
    49                 {  
     46                if ( ! class_exists( 'db_main' ) ) {  
    5047                        require_once( KERNEL_PATH.'class_db.php' ); 
    5148                        if ( $this->ezipbIni->variable( "ezipb", "USE_UNIQUE_CONNECTION" ) == "enabled" ) 
     
    6865                $this->DB->obj['force_new_connection'] = isset($this->vars['sql_force_new_connection']) ? $this->vars['sql_force_new_connection'] : 0; 
    6966                $this->DB->obj['use_shutdown']         = USE_SHUTDOWN; 
    70                 # Error log 
    71                 $this->DB->obj['error_log']            = ROOT_PATH . 'cache/sql_error_log_'.date('m_d_y').'.cgi'; 
    72                 $this->DB->obj['use_error_log']        = IN_DEV ? 0 : 1; 
    73                 # Debug log - Don't use this on a production board! 
    74                 $this->DB->obj['debug_log']            = ROOT_PATH . 'cache/sql_debug_log_'.date('m_d_y').'.cgi'; 
     67                //$this->DB->obj['error_log']            = ROOT_PATH . 'cache/sql_error_log_'.date('m_d_y').'.cgi'; 
     68                $this->DB->obj['use_error_log']        = 0; 
     69                //$this->DB->obj['debug_log']            = ROOT_PATH . 'cache/sql_debug_log_'.date('m_d_y').'.cgi'; 
    7570                $this->DB->obj['use_debug_log']        = 0; 
    7671                 
    77                 //----------------------------------- 
    78                 // Load query file 
    79                 //----------------------------------- 
    80                  
     72 
     73                /* Load query file */ 
    8174                if ( defined( 'IPB_LOAD_SQL' ) ) 
    82                 { 
    8375                        $this->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$this->vars['sql_driver'].'_'. IPB_LOAD_SQL .'.php'; 
    84                 } 
    8576                else if ( IPB_THIS_SCRIPT == 'admin' ) 
    86                 { 
    8777                        $this->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$this->vars['sql_driver'].'_admin_queries.php'; 
    88                 } 
    8978                else 
    90                 { 
    9179                        $this->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$this->vars['sql_driver'].'_queries.php'; 
    92                 } 
    9380                         
    94                 //----------------------------------- 
    95                 // Required vars? 
    96                 //----------------------------------- 
    97                  
    98                 if ( is_array( $this->DB->connect_vars ) and count( $this->DB->connect_vars ) ) 
    99                 { 
    100                         foreach( $this->DB->connect_vars as $k => $v ) 
    101                         { 
     81                /* Required vars? */ 
     82                if ( is_array( $this->DB->connect_vars ) and count( $this->DB->connect_vars ) ) { 
     83                        foreach( $this->DB->connect_vars as $k => $v ) { 
    10284                                $this->DB->connect_vars[ $k ] = isset($this->vars[ $k ]) ? $this->vars[ $k ] : ''; 
    10385                        } 
    10486                } 
    10587                 
    106                 //-------------------------------- 
    107                 // Backwards compat 
    108                 //-------------------------------- 
     88                /* Backwards compat */ 
     89                if ( !isset($this->DB->connect_vars['mysql_tbl_type']) OR !$this->DB->connect_vars['mysql_tbl_type'] ) 
     90                        $this->DB->connect_vars['mysql_tbl_type'] = 'myisam'; 
    10991                 
    110                 if ( !isset($this->DB->connect_vars['mysql_tbl_type']) OR !$this->DB->connect_vars['mysql_tbl_type'] ) 
    111                 { 
    112                         $this->DB->connect_vars['mysql_tbl_type'] = 'myisam'; 
    113                 } 
    114                  
    115                 //-------------------------------- 
    116                 // Make CONSTANT 
    117                 //-------------------------------- 
    118                  
     92                /* Make CONSTANT */ 
    11993                define( 'SQL_PREFIX'              , $this->DB->obj['sql_tbl_prefix'] ); 
    12094                define( 'SQL_DRIVER'              , $this->vars['sql_driver']        ); 
    12195                define( 'IPS_MAIN_DB_CLASS_LOADED', TRUE ); 
    12296                 
    123                 //-------------------------------- 
    124                 // Get a DB connection 
    125                 //-------------------------------- 
     97                /* Get a DB connection */ 
    12698                $this->DB->connect(); 
    127  
    12899                 
     100                /* IPS DB LOADED */ 
     101                if ( ! defined( 'IPSCLASS_DB_LOADED' ) ) 
     102                        define( 'IPSCLASS_DB_LOADED', 1 ); 
    129103                 
    130                 //----------------------------------------- 
    131                 // IPS DB LOADED 
    132                 //----------------------------------------- 
    133                  
    134                 if ( ! defined( 'IPSCLASS_DB_LOADED' ) ) 
    135                 { 
    136                         define( 'IPSCLASS_DB_LOADED', 1 ); 
    137                 } 
    138                  
    139                 //----------------------------------------- 
    140                 // Clean up 
    141                 //----------------------------------------- 
    142                  
     104                /* Clean up */ 
    143105                unset( $classname ); 
    144106                 
    145                 $this->memory_debug_add( "CORE: DB Connection Made", $_pre_load ); 
     107                //$this->memory_debug_add( "CORE: DB Connection Made", $_pre_load ); 
    146108        } 
    147109         
  • ez_publish/ezipb/trunk/classes/sql/ezipb_db_mysql.php

    r3 r19  
    3030 */ 
    3131  
    32  if ( ! defined('KERNEL_PATH') ) 
    33 { 
     32 if ( ! defined('KERNEL_PATH') ) { 
    3433        if( defined('INS_KERNEL_PATH') ) 
    35         { 
    3634                define( 'KERNEL_PATH', INS_KERNEL_PATH ); 
    37         } 
    3835        else 
    39         { 
    4036                define( 'KERNEL_PATH', str_replace( "//", "/", str_replace( "\\", "/", dirname( __FILE__ ) ) ) . "/" ); 
    41         } 
    4237} 
    4338 
     
    4540// MySQLi and PHP 5.0.5 don't get along well 
    4641//----------------------------------------- 
    47   
    4842$versions               = explode( ".", phpversion() ); 
    4943 
    5044if( $versions[0] == 5 AND $versions[1] == 0 AND $versions[2] == 5 && ! defined( 'FORCE_MYSQL_ONLY' ) ) 
    51 { 
    5245        define( 'FORCE_MYSQL_ONLY', 1 ); 
    53 } 
    5446 
     47/* On force MySQL */ 
    5548if ( extension_loaded('mysqli') AND ! defined( 'FORCE_MYSQL_ONLY' ) ) 
    56 { 
    5749        require( KERNEL_PATH."class_db_mysqli_client.php" ); 
    58 } 
    5950else 
    60 { 
    6151        require_once eZExtension::baseDirectory() . '/ezipb/classes/sql/ezipb_db_mysql_client.php'; 
    62 } 
    6352 
    64 //----------------------------------------- 
    65 // Clean up 
    66 //----------------------------------------- 
    67  
     53/* Clean up */ 
    6854unset( $versions ); 
    6955 
  • ez_publish/ezipb/trunk/classes/sql/ezipb_db_mysql_client.php

    r14 r19  
    5858        } 
    5959        else {  
    60                         if ( IPS_MAIN_DB_CLASS_LEGACY ) { 
     60                        if ( IPS_MAIN_DB_CLASS_LEGACY ) 
    6161                                $this->connection_id = $this->ezdb->DBConnection; 
    62                         } 
    63                         else { 
     62                        else 
    6463                                $this->connection_id = $this->ezdb->DBConnection; 
    65                         } 
    6664                } 
    6765                 
     
    8078         
    8179     
     80     
     81    /** 
     82     * Surcharge de la fonction query pour les logs de requêtes 
     83     * 
     84     * @param string $the_query Requêtes 
     85     * @param int $bypass 
     86     * @return query 
     87     */ 
    8288    function query($the_query, $bypass=0) { 
    8389 
     
    9096                return db_driver_mysql::query($the_query, $bypass=0);    
    9197    } 
    92  } 
     98     
     99 }      // EOC 
     100  
    93101 ?>