Changeset 6021


Ignore:
Timestamp:
04/30/10 13:44:12 (9 years ago)
Author:
plg
Message:

transform the old mysql.inc.php variables into the new database.inc.php
variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/prepare21upgrade/prep21up.php

    r6014 r6021  
    136136if (is_readable($file)) 
    137137{ 
    138   copy($file, $dir.'/local/config/database.inc.php'); 
     138  $file_content = '<?php 
     139$conf[\'dblayer\'] = \'mysql\'; 
     140$conf[\'db_base\'] = \''.$cfgBase.'\'; 
     141$conf[\'db_user\'] = \''.$cfgUser.'\'; 
     142$conf[\'db_password\'] = \''.$cfgPassword.'\'; 
     143$conf[\'db_host\'] = \''.$cfgHote.'\'; 
     144 
     145$prefixeTable = \''.$prefixeTable.'\'; 
     146 
     147define(\'PHPWG_INSTALLED\', true);'; 
     148  if (defined('PWG_CHARSET')) 
     149  { 
     150    $file_content.= ' 
     151define(\'PWG_CHARSET\', \'utf-8\'); 
     152define(\'DB_CHARSET\', \'utf8\'); 
     153define(\'DB_COLLATE\', \'\');'; 
     154  } 
     155  $file_content.= ' 
     156?'.'>'; 
     157  $new_config_file = $dir.'/local/config/database.inc.php'; 
     158  file_put_contents($new_config_file, $file_content); 
     159  @chmod($new_config_file, 0777); 
    139160} 
    140161 
Note: See TracChangeset for help on using the changeset viewer.