Changeset 14 for ez_publish/ezipb/trunk

Show
Ignore:
Timestamp:
09/03/07 21:47:32 (16 months ago)
Author:
llaumgui
Message:

Requêtes IPB dans le débug eZ

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ez_publish/ezipb/trunk/classes/sql/ezipb_db_mysql_client.php

    r3 r14  
    2727 *  
    2828 * @author Guillaume Kulakowski <guillaume_AT_llaumgui_DOT_com> 
    29  * @version 1x.0 
     29 * @version 1.0 
    3030 */ 
    3131  
     32 /* Drivers IPB standards */ 
    3233 require( KERNEL_PATH."class_db_mysql_client.php" ); 
    3334  
    3435 class ezipb_db_driver_mysql extends db_driver_mysql { 
    3536         
     37        protected $ezdb;                // Connexion eZ. 
    3638         
    3739         
    38         function connect() 
    39         { 
    40                 $db =& eZDB::instance(); 
     40         
     41        /** 
     42         * Surcharge de la fonction connect de db_driver_mysql qui  
     43         * permet à IPB d'utiliser la connexion ouverte par eZ 
     44         * 
     45         * @return Booléen 
     46         */ 
     47        function connect() { 
     48                 
     49                // eZ 
     50                $this->ezdb =& eZDB::instance(); 
     51         
     52                // IPB 
     53                $this->_set_prefix(); 
     54                $this->_load_cache_file(); 
    4155         
    42          
    43          
    44          
    45                 //----------------------------------------- 
    46         // Done SQL prefix yet? 
    47         //----------------------------------------- 
    48          
    49         $this->_set_prefix(); 
    50          
    51         //----------------------------------------- 
    52         // Load query file 
    53         //----------------------------------------- 
    54          
    55         $this->_load_cache_file(); 
    56          
    57         //----------------------------------------- 
    58         // Connect 
    59         //----------------------------------------- 
    60         if ( $this->obj['persistent'] AND ! IPS_MAIN_DB_CLASS_LEGACY ) 
    61         { 
    62             $this->connection_id = $db->DBConnection; 
     56        if ( $this->obj['persistent'] AND ! IPS_MAIN_DB_CLASS_LEGACY ) { 
     57            $this->connection_id = $this->ezdb->DBConnection; 
    6358        } 
    64         else 
    65         {  
    66                         if ( IPS_MAIN_DB_CLASS_LEGACY ) 
    67                 { 
    68                                 $this->connection_id = $db->DBConnection; 
     59        else {  
     60                        if ( IPS_MAIN_DB_CLASS_LEGACY ) { 
     61                                $this->connection_id = $this->ezdb->DBConnection; 
    6962                        } 
    70                         else 
    71                         { 
    72                                 $this->connection_id = $db->DBConnection; 
     63                        else { 
     64                                $this->connection_id = $this->ezdb->DBConnection; 
    7365                        } 
    7466                } 
    7567                 
    76                 if ( ! $this->connection_id ) 
    77                 { 
     68                if ( ! $this->connection_id ) { 
    7869                        $this->fatal_error(); 
    7970                        return FALSE; 
    8071                } 
    8172                 
    82         if ( ! mysql_select_db($this->obj['sql_database'], $this->connection_id) ) 
    83         { 
     73        if ( ! mysql_select_db($this->obj['sql_database'], $this->connection_id) ) { 
    8474                $this->fatal_error(); 
    8575                return FALSE; 
     
    8979    } 
    9080         
     81     
     82    function query($the_query, $bypass=0) { 
     83 
     84        /* 
     85         * La fonction reportQuery() étant private on la recopie ici... 
     86         */ 
     87        $debug = eZDebug::instance(); 
     88                $debug->writeNotice( "$the_query", "IPB query", "" ); 
     89                 
     90                return db_driver_mysql::query($the_query, $bypass=0);    
     91    } 
    9192 } 
    9293 ?>