Changeset 2863 for trunk/install


Ignore:
Timestamp:
Nov 12, 2008, 1:40:20 PM (15 years ago)
Author:
patdenice
Message:
  • Remove advises of file removal at the end of install/upgrade.
  • Automatic change mysql.inc.php if file is writable, else purpose manual change to user.
Location:
trunk/install
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/install/db/65-database.php

    r2836 r2863  
    103103
    104104// +-----------------------------------------------------------------------+
    105 // load the config file
    106   $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 // +-----------------------------------------------------------------------+
    124105// load all the user languages
    125106  $all_langs=array();
     
    275256
    276257// +-----------------------------------------------------------------------+
    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.'\');
    281261define(\'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);
     262define(\'DB_COLLATE\',  \'\');'
     263  );
    288264
    289265  foreach ($all_langs as $old_lang=>$lang_data)
  • trunk/install/upgrade_1.3.1.php

    r2838 r2863  
    596596}
    597597
    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
     599array_push($mysql_changes, 'define(\'PHPWG_INSTALLED\', true);');
    607600
    608601// Send infos
Note: See TracChangeset for help on using the changeset viewer.