Changeset 5982 for trunk/install.php


Ignore:
Timestamp:
Apr 28, 2010, 4:28:05 PM (14 years ago)
Author:
plg
Message:

feature 1630: upgrade to Piwigo 2.1 :-)

bug 1604: only activate core themes not all themes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/install.php

    r5781 r5982  
    263263if ( isset( $_POST['install'] ))
    264264{
    265   if ($pwg_db_link = install_db_connect($infos, $errors))
    266   {
    267     $required_version = constant('REQUIRED_'.strtoupper($dblayer).'_VERSION');
    268     if ( version_compare(pwg_get_db_version(), $required_version, '>=') )
    269     {
    270       $pwg_charset = 'utf-8';
    271       $pwg_db_charset = 'utf8';
    272       if ($dblayer=='mysql')
    273       {
    274         $install_charset_collate = "DEFAULT CHARACTER SET $pwg_db_charset";
    275         pwg_query('SET NAMES "'.$pwg_db_charset.'"');
    276       }
    277       else
    278       {
    279         $install_charset_collate = '';
    280       }
    281     }
    282     else
    283     {
    284       $pwg_charset = 'iso-8859-1';
    285       $pwg_db_charset = 'latin1';
    286       $install_charset_collate = '';
    287       if ( !array_key_exists($language, $languages->get_fs_languages($pwg_charset) ) )
    288       {
    289         $language='en_UK';
    290       }
    291     }
    292   }
     265  install_db_connect($infos, $errors);
     266  pwg_db_check_charset();
    293267
    294268  $webmaster = trim(preg_replace( '/\s{2,}/', ' ', $admin_name ));
     
    321295
    322296define(\'PHPWG_INSTALLED\', true);
    323 define(\'PWG_CHARSET\', \''.$pwg_charset.'\');
    324 define(\'DB_CHARSET\', \''.$pwg_db_charset.'\');
     297define(\'PWG_CHARSET\', \'utf-8\');
     298define(\'DB_CHARSET\', \'utf8\');
    325299define(\'DB_COLLATE\', \'\');
    326300
     
    351325      PHPWG_ROOT_PATH.'install/piwigo_structure-'.$dblayer.'.sql',
    352326      DEFAULT_PREFIX_TABLE,
    353       $prefixeTable
     327      $prefixeTable,
     328      $dblayer
    354329      );
    355330    // We fill the tables with basic informations
     
    357332      PHPWG_ROOT_PATH.'install/config.sql',
    358333      DEFAULT_PREFIX_TABLE,
    359       $prefixeTable
     334      $prefixeTable,
     335      $dblayer
    360336      );
    361337
     
    367343
    368344    // fill languages table
    369     foreach ($languages->get_fs_languages($pwg_charset) as $language_code => $language_name)
     345    foreach ($languages->get_fs_languages() as $language_code => $language_name)
    370346    {
    371347      $languages->perform_action('activate', $language_code);
     
    379355    if (!defined('PWG_CHARSET'))
    380356    {
    381       define('PWG_CHARSET', $pwg_charset);
    382     }
    383     activate_all_themes();
     357      define('PWG_CHARSET', 'utf-8');
     358    }
     359    activate_core_themes();
    384360
    385361    $insert = array(
Note: See TracChangeset for help on using the changeset viewer.