Changeset 2863 for trunk/install
- Timestamp:
- Nov 12, 2008, 1:40:20 PM (15 years ago)
- Location:
- trunk/install
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/install/db/65-database.php
r2836 r2863 103 103 104 104 // +-----------------------------------------------------------------------+ 105 // load the config file106 $config_file = PHPWG_ROOT_PATH.'include/mysql.inc.php';107 $config_file_contents = @file_get_contents($config_file);108 if ($config_file_contents === false)109 {110 die('CANNOT LOAD '.$config_file);111 }112 $php_end_tag = strrpos($config_file_contents, '?'.'>');113 if ($php_end_tag === false)114 {115 die('CANNOT FIND PHP END TAG IN '.$config_file);116 }117 if (!is_writable($config_file))118 {119 die('FILE NOT WRITABLE '.$config_file);120 }121 122 123 // +-----------------------------------------------------------------------+124 105 // load all the user languages 125 106 $all_langs=array(); … … 275 256 276 257 // +-----------------------------------------------------------------------+ 277 // write the result to file and update #user_infos.language 278 $config_file_contents = 279 substr($config_file_contents, 0, $php_end_tag).' 280 define(\'PWG_CHARSET\', \''.$pwg_charset.'\'); 258 // changes to write in mysql.inc.php 259 array_push($mysql_changes, 260 'define(\'PWG_CHARSET\', \''.$pwg_charset.'\'); 281 261 define(\'DB_CHARSET\', \''.$db_charset.'\'); 282 define(\'DB_COLLATE\', \'\'); 283 '.substr($config_file_contents, $php_end_tag); 284 285 $fp = @fopen( $config_file, 'w' ); 286 @fputs($fp, $config_file_contents, strlen($config_file_contents)); 287 @fclose($fp); 262 define(\'DB_COLLATE\', \'\');' 263 ); 288 264 289 265 foreach ($all_langs as $old_lang=>$lang_data) -
trunk/install/upgrade_1.3.1.php
r2838 r2863 596 596 } 597 597 598 // Insert define('PHPWG_INSTALLED', true); in mysql.inc.php 599 $config_file_contents = 600 substr($config_file_contents, 0, $php_end_tag).' 601 define(\'PHPWG_INSTALLED\', true); 602 '.substr($config_file_contents, $php_end_tag); 603 604 $fp = @fopen( $config_file, 'w' ); 605 @fputs($fp, $config_file_contents, strlen($config_file_contents)); 606 @fclose($fp); 598 // changes to write in mysql.inc.php 599 array_push($mysql_changes, 'define(\'PHPWG_INSTALLED\', true);'); 607 600 608 601 // Send infos
Note: See TracChangeset
for help on using the changeset viewer.