Changeset 5220


Ignore:
Timestamp:
Mar 21, 2010, 6:20:56 PM (11 years ago)
Author:
patdenice
Message:

feature 1255: set mysql as default engine.

Location:
trunk
Files:
4 edited

Legend:

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

    r5196 r5220  
    9090    {
    9191      $engines[$engine_name]['label'] = $engine['engine'];
    92       $engines[$engine_name]['available'] = 'disabled';
     92      $engines[$engine_name]['available'] = false;
    9393
    9494      if (isset($engine['function_available'])
     
    105105  }
    106106
    107   if (count($engines)>1)
    108   {
    109     $engines[$GLOBALS['conf']['dbengine_select_default']]['selected'] = true;
    110   }
    111  
    112107  if ($engines['sqlite']['available'] && $engines['pdo-sqlite']['available'])
    113108  {
  • trunk/admin/themes/default/template/install.tpl

    r5219 r5220  
    113113          {foreach from=$F_DB_ENGINES key=k item=v}
    114114          <option value="{$k}"
    115                   {if $k==$F_DB_LAYER or $v.selected} selected="selected"{/if}
    116                   {if $v.available!=1} disabled="disabled"{/if}
     115                  {if $k==$F_DB_LAYER and $v.available} selected="selected"{/if}
     116                  {if !$v.available} disabled="disabled"{/if}
    117117                  >{$v.label}</option>
    118118          {/foreach}
  • trunk/include/config_default.inc.php

    r5215 r5220  
    537537// choices : sqlite, mysql, pgsql, pdo-sqlite
    538538// see include/dblayer/dblayers.inc.php
    539 $conf['dbengine_select_default'] = 'sqlite';
     539$conf['dbengine_select_default'] = 'mysql';
    540540
    541541// pass_convert : function to crypt or hash the clear user password to store
  • trunk/install.php

    r5215 r5220  
    9999define('DEFAULT_PREFIX_TABLE', 'piwigo_');
    100100
     101if (isset($_POST['install']))
     102{
     103  $prefixeTable = $_POST['prefix'];
     104}
     105else
     106{
     107  $prefixeTable = DEFAULT_PREFIX_TABLE;
     108}
     109
     110include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
     111@include(PHPWG_ROOT_PATH. 'local/config/config.inc.php');
     112
    101113// Obtain various vars
    102114$dbhost = (!empty($_POST['dbhost'])) ? $_POST['dbhost'] : 'localhost';
     
    104116$dbpasswd = (!empty($_POST['dbpasswd'])) ? $_POST['dbpasswd'] : '';
    105117$dbname = (!empty($_POST['dbname'])) ? $_POST['dbname'] : '';
    106 $dblayer = (!empty($_POST['dblayer'])) ? $_POST['dblayer'] : 'mysql';
    107 
    108 if (isset($_POST['install']))
    109 {
    110   $table_prefix = $_POST['prefix'];
    111 }
    112 else
    113 {
    114   $table_prefix = DEFAULT_PREFIX_TABLE;
    115 }
     118$dblayer = (!empty($_POST['dblayer'])) ? $_POST['dblayer'] : $conf['dbengine_select_default'];
    116119
    117120$admin_name = (!empty($_POST['admin_name'])) ? $_POST['admin_name'] : '';
     
    157160}
    158161
    159 $prefixeTable = $table_prefix;
    160 include(PHPWG_ROOT_PATH . 'include/config_default.inc.php');
    161 @include(PHPWG_ROOT_PATH. 'local/config/config.inc.php');
    162162include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$dblayer.'.inc.php');
    163163include(PHPWG_ROOT_PATH . 'include/constants.php');
     
    290290$conf[\'db_host\'] = \''.$dbhost.'\';
    291291
    292 $prefixeTable = \''.$table_prefix.'\';
     292$prefixeTable = \''.$prefixeTable.'\';
    293293
    294294define(\'PHPWG_INSTALLED\', true);
     
    317317      PHPWG_ROOT_PATH.'install/piwigo_structure-'.$dblayer.'.sql',
    318318      DEFAULT_PREFIX_TABLE,
    319       $table_prefix
     319      $prefixeTable
    320320      );
    321321    // We fill the tables with basic informations
     
    323323      PHPWG_ROOT_PATH.'install/config.sql',
    324324      DEFAULT_PREFIX_TABLE,
    325       $table_prefix
     325      $prefixeTable
    326326      );
    327327
    328328    $query = '
    329 INSERT INTO '.$table_prefix.'config (param,value,comment)
     329INSERT INTO '.$prefixeTable.'config (param,value,comment)
    330330   VALUES (\'secret_key\',\'md5('.pwg_db_cast_to_text(DB_RANDOM_FUNCTION.'()').')\',
    331331   \'a secret key specific to the gallery for internal use\');';
     
    437437      'F_DB_USER' => $dbuser,
    438438      'F_DB_NAME' => $dbname,
    439       'F_DB_PREFIX' => $table_prefix,
     439      'F_DB_PREFIX' => $prefixeTable,
    440440      'F_ADMIN' => $admin_name,
    441441      'F_ADMIN_EMAIL' => $admin_mail,
Note: See TracChangeset for help on using the changeset viewer.