Dotclear

Changeset 1743:a659700da036


Ignore:
Timestamp:
09/06/13 21:36:57 (12 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add mysqli support, step 1, addresses #1450

Files:
9 edited

Legend:

Unmodified
Added
Removed
  • README.md

    r1578 r1743  
    5050    * iconv 
    5151    * simplexml 
    52     * mysql, postgresql or sqlite 
     52    * mysql, mysqli, postgresql or sqlite 
    5353 * A database server (MySQL or PostgreSQL) or SQLite. 
    5454 
  • admin/install/check.php

    r1179 r1743  
    4949     } 
    5050      
    51      if ($con->driver() == 'mysql') 
     51     if ($con->driver() == 'mysql' || $con->driver() == 'mysqli') 
    5252     { 
    5353          if (version_compare($con->version(),'4.1','<')) 
  • admin/install/wizard.php

    r1399 r1743  
    5555} 
    5656 
    57 $DBDRIVER = !empty($_POST['DBDRIVER']) ? $_POST['DBDRIVER'] : 'mysql'; 
     57$DBDRIVER = !empty($_POST['DBDRIVER']) ? $_POST['DBDRIVER'] : 'mysqli'; 
    5858$DBHOST = !empty($_POST['DBHOST']) ? $_POST['DBHOST'] : ''; 
    5959$DBNAME = !empty($_POST['DBNAME']) ? $_POST['DBNAME'] : ''; 
     
    179179'<form action="wizard.php" method="post">'. 
    180180'<p><label class="required" for="DBDRIVER"><abbr title="'.__('Required field').'">*</abbr> '.__('Database type:').'</label> '. 
    181 form::combo('DBDRIVER',array('MySQL'=>'mysql','PostgreSQL'=>'pgsql'),$DBDRIVER).'</p>'. 
     181form::combo('DBDRIVER',array(__('MySQL (deprecated)')=>'mysql',__('MySQLi')=>'mysqli',__('PostgreSQL')=>'pgsql'),$DBDRIVER).'</p>'. 
    182182'<p><label for="DBHOST">'.__('Database Host Name:').'</label> '. 
    183183form::field('DBHOST',30,255,html::escapeHTML($DBHOST)).'</p>'. 
  • debian/control

    r0 r1743  
    88Package: dotclear 
    99Architecture: all 
    10 Depends: ${misc:Depends}, apache2 | httpd | apache, libclearbricks, php5-pgsql | php5-sqlite | php5-mysql, php5-gd 
     10Depends: ${misc:Depends}, apache2 | httpd | apache, libclearbricks, php5-pgsql | php5-sqlite | php5-mysql | php5-mysqli, php5-gd 
    1111Suggests: php5-tidy 
    1212Description: DotClear 2 
  • inc/config.php.in

    r1535 r1743  
    1212if (!defined('DC_RC_PATH')) { return; } 
    1313 
    14 // Database driver (mysql, pgsql, sqlite) 
     14// Database driver (mysql, mysqli, pgsql, sqlite) 
    1515define('DC_DBDRIVER',''); 
    1616 
  • inc/core/class.dc.blog.php

    r1689 r1743  
    658658          if (!$rs->isEmpty()) 
    659659          { 
    660                if ($this->con->driver() == 'mysql') { 
     660               if ($this->con->driver() == 'mysql' || $this->con->driver() == 'mysqli') { 
    661661                    $clause = "REGEXP '^".$this->con->escape($url)."[0-9]+$'"; 
    662662               } elseif ($this->con->driver() == 'pgsql') { 
     
    18281828          if (!$rs->isEmpty()) 
    18291829          { 
    1830                if ($this->con->driver() == 'mysql') { 
     1830               if ($this->con->driver() == 'mysql' || $this->con->driver() == 'mysqli') { 
    18311831                    $clause = "REGEXP '^".$this->con->escape($url)."[0-9]+$'"; 
    18321832               } elseif ($this->con->driver() == 'pgsql') { 
     
    21872187           
    21882188          # mySQL uses "JOIN" synthax 
    2189           if ($this->con->driver() == 'mysql') { 
     2189          if ($this->con->driver() == 'mysql' || $this->con->driver() == 'mysqli') { 
    21902190               $strReq .=  
    21912191                    'JOIN '.$this->prefix.'post tp ON tc.post_id = tp.post_id '; 
     
    21962196           
    21972197          # pgSQL uses "FROM" synthax 
    2198           if ($this->con->driver() != 'mysql') { 
     2198          if ($this->con->driver() != 'mysql' || $this->con->driver() == 'mysqli') { 
    21992199               $strReq .=  
    22002200                    'FROM '.$this->prefix.'post tp '; 
     
    22062206           
    22072207          # add pgSQL "WHERE" clause 
    2208           if ($this->con->driver() != 'mysql') { 
     2208          if ($this->con->driver() != 'mysql' || $this->con->driver() == 'mysqli') { 
    22092209               $strReq .=  
    22102210                    'AND tc.post_id = tp.post_id '; 
     
    22652265           
    22662266          # mySQL uses "INNER JOIN" synthax 
    2267           if ($this->con->driver() == 'mysql') { 
     2267          if ($this->con->driver() == 'mysql' || $this->con->driver() == 'mysqli') { 
    22682268               $strReq =  
    22692269                    'DELETE FROM tc '. 
     
    23022302           
    23032303          # mySQL uses "INNER JOIN" synthax 
    2304           if ($this->con->driver() == 'mysql') { 
     2304          if ($this->con->driver() == 'mysql' || $this->con->driver() == 'mysqli') { 
    23052305               $strReq =  
    23062306                    'DELETE FROM tc '. 
  • inc/core/class.dc.core.php

    r1698 r1743  
    6464          if ($this->con instanceof mysqlConnection) { 
    6565               mysqlConnection::$weak_locks = true; 
     66          } elseif ($this->con instanceof mysqliConnection) { 
     67               mysqliConnection::$weak_locks = true; 
    6668          } 
    6769           
  • locales/fr/main.po

    r1728 r1743  
    33303330msgid "You do not have sufficient permissions to write to this folder." 
    33313331msgstr "Vous n'avez pas les droits suffisants pour écrire dans ce répertoire." 
     3332 
     3333msgid "MySQL (deprecated)" 
     3334msgstr "MySQL (obsolète)" 
  • plugins/importExport/inc/flat/class.flat.import.php

    r1093 r1743  
    160160                         if (in_array($last_line_name,$constrained)) { 
    161161                              # UNDEFER 
    162                               if ($this->con->driver() == 'mysql') $this->con->execute('SET foreign_key_checks = 1'); 
     162                              if ($this->con->driver() == 'mysql' || $this->con->driver() == 'mysqli') $this->con->execute('SET foreign_key_checks = 1'); 
    163163                              if ($this->con->driver() == 'pgsql') $this->con->execute('SET CONSTRAINTS ALL DEFERRED'); 
    164164                         } 
     
    166166                         if (in_array($line->__name,$constrained)) { 
    167167                              # DEFER 
    168                               if ($this->con->driver() == 'mysql') $this->con->execute('SET foreign_key_checks = 0'); 
     168                              if ($this->con->driver() == 'mysql' || $this->con->driver() == 'mysqli') $this->con->execute('SET foreign_key_checks = 0'); 
    169169                              if ($this->con->driver() == 'pgsql') $this->con->execute('SET CONSTRAINTS ALL IMMEDIATE'); 
    170170                         } 
     
    205205               } 
    206206                
    207                if ($this->con->driver() == 'mysql') $this->con->execute('SET foreign_key_checks = 1'); 
     207               if ($this->con->driver() == 'mysql' || $this->con->driver() == 'mysqli') $this->con->execute('SET foreign_key_checks = 1'); 
    208208               if ($this->con->driver() == 'pgsql') $this->con->execute('SET CONSTRAINTS ALL DEFERRED'); 
    209209          } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map