Changeset 14 for ez_publish/ezipb/trunk
- Timestamp:
- 09/03/07 21:47:32 (16 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
ez_publish/ezipb/trunk/classes/sql/ezipb_db_mysql_client.php
r3 r14 27 27 * 28 28 * @author Guillaume Kulakowski <guillaume_AT_llaumgui_DOT_com> 29 * @version 1 x.029 * @version 1.0 30 30 */ 31 31 32 /* Drivers IPB standards */ 32 33 require( KERNEL_PATH."class_db_mysql_client.php" ); 33 34 34 35 class ezipb_db_driver_mysql extends db_driver_mysql { 35 36 37 protected $ezdb; // Connexion eZ. 36 38 37 39 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(); 41 55 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; 63 58 } 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; 69 62 } 70 else 71 { 72 $this->connection_id = $db->DBConnection; 63 else { 64 $this->connection_id = $this->ezdb->DBConnection; 73 65 } 74 66 } 75 67 76 if ( ! $this->connection_id ) 77 { 68 if ( ! $this->connection_id ) { 78 69 $this->fatal_error(); 79 70 return FALSE; 80 71 } 81 72 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) ) { 84 74 $this->fatal_error(); 85 75 return FALSE; … … 89 79 } 90 80 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 } 91 92 } 92 93 ?>
