Changeset 5239


Ignore:
Timestamp:
03/22/10 00:41:19 (10 years ago)
Author:
patdenice
Message:

feature 1255: Move $confdb_sqlite_default and $confdbengine_select_default in install.php (as constants).
PDO::SQLite is now displayed as SQLite in install page.
Always display unique SQLite engine.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions_install.inc.php

    r5220 r5239  
    105105  } 
    106106 
    107   if ($engines['sqlite']['available'] && $engines['pdo-sqlite']['available']) 
     107  if ($engines['sqlite']['available'] and !$engines['pdo-sqlite']['available']) 
    108108  { 
    109     if ($GLOBALS['conf']['db_sqlite_default']=='native') 
    110     { 
    111       unset($engines['pdo-sqlite']); 
    112     } 
    113     else  
    114     { 
    115       unset($engines['sqlite']); 
    116     } 
     109    unset($engines['pdo-sqlite']); 
     110  } 
     111  elseif ($engines['pdo-sqlite']['available'] and !$engines['sqlite']['available']) 
     112  { 
     113    unset($engines['sqlite']); 
     114  } 
     115  elseif (DEFAULT_DB_SQLITE=='native') 
     116  { 
     117    unset($engines['pdo-sqlite']); 
     118  } 
     119  else 
     120  { 
     121    unset($engines['sqlite']); 
    117122  } 
    118123 
  • trunk/include/config_default.inc.php

    r5220 r5239  
    528528  'email' => 'mail_address' 
    529529  ); 
    530  
    531 // database engine default choice between sqlite (native or via pdo) 
    532 // if the twice are available. 
    533 // $conf['db_sqlite_default'] = 'pdo';  
    534 $conf['db_sqlite_default'] = 'native';  
    535  
    536 // default database engine proposed if severals are available 
    537 // choices : sqlite, mysql, pgsql, pdo-sqlite 
    538 // see include/dblayer/dblayers.inc.php 
    539 $conf['dbengine_select_default'] = 'mysql';  
    540530 
    541531// pass_convert : function to crypt or hash the clear user password to store 
  • trunk/include/dblayer/dblayers.inc.php

    r5196 r5239  
    3535                            ); 
    3636 
    37 $dblayers['pdo-sqlite'] = array('engine' => 'PDO::SQLite', 
     37$dblayers['pdo-sqlite'] = array('engine' => 'SQLite', 
    3838                                'class_available' => 'PDO' 
    3939                                ); 
  • trunk/install.php

    r5236 r5239  
    9999define('DEFAULT_PREFIX_TABLE', 'piwigo_'); 
    100100 
     101// default database engine proposed if severals are available 
     102// choices : sqlite, mysql, pgsql, pdo-sqlite 
     103// see include/dblayer/dblayers.inc.php 
     104define('DEFAULT_DB_ENGINE', 'mysql'); 
     105 
     106// database engine default choice between sqlite (native or via pdo) 
     107// if the twice are available. 
     108define('DEFAULT_DB_SQLITE', 'native');  
     109 
    101110if (isset($_POST['install'])) 
    102111{ 
     
    116125$dbpasswd = (!empty($_POST['dbpasswd'])) ? $_POST['dbpasswd'] : ''; 
    117126$dbname = (!empty($_POST['dbname'])) ? $_POST['dbname'] : ''; 
    118 $dblayer = (!empty($_POST['dblayer'])) ? $_POST['dblayer'] : $conf['dbengine_select_default']; 
     127$dblayer = (!empty($_POST['dblayer'])) ? $_POST['dblayer'] : DEFAULT_DB_ENGINE; 
    119128 
    120129$admin_name = (!empty($_POST['admin_name'])) ? $_POST['admin_name'] : ''; 
Note: See TracChangeset for help on using the changeset viewer.