aboutsummaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2008-11-12 12:40:20 +0000
committerpatdenice <patdenice@piwigo.org>2008-11-12 12:40:20 +0000
commitcd9f45fd1dd2ebc2e6795c15a3f3eddb38e95e7d (patch)
treea1313450a3956f3be90cb6ad1f3309a93d32705d /install
parent1d9821abd15519ad4732854e277ae9163f5e2a7d (diff)
- 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. git-svn-id: http://piwigo.org/svn/trunk@2863 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'install')
-rw-r--r--install/db/65-database.php34
-rw-r--r--install/upgrade_1.3.1.php11
2 files changed, 7 insertions, 38 deletions
diff --git a/install/db/65-database.php b/install/db/65-database.php
index c445b0ab6..6a26a1478 100644
--- a/install/db/65-database.php
+++ b/install/db/65-database.php
@@ -102,25 +102,6 @@ if ( !defined('PWG_CHARSET') )
$upgrade_log = '';
// +-----------------------------------------------------------------------+
-// load the config file
- $config_file = PHPWG_ROOT_PATH.'include/mysql.inc.php';
- $config_file_contents = @file_get_contents($config_file);
- if ($config_file_contents === false)
- {
- die('CANNOT LOAD '.$config_file);
- }
- $php_end_tag = strrpos($config_file_contents, '?'.'>');
- if ($php_end_tag === false)
- {
- die('CANNOT FIND PHP END TAG IN '.$config_file);
- }
- if (!is_writable($config_file))
- {
- die('FILE NOT WRITABLE '.$config_file);
- }
-
-
-// +-----------------------------------------------------------------------+
// load all the user languages
$all_langs=array();
$query='
@@ -274,17 +255,12 @@ ALTER TABLE t1 CHANGE c1 c1 TEXT CHARACTER SET utf8;
// +-----------------------------------------------------------------------+
-// write the result to file and update #user_infos.language
- $config_file_contents =
- substr($config_file_contents, 0, $php_end_tag).'
-define(\'PWG_CHARSET\', \''.$pwg_charset.'\');
+// changes to write in mysql.inc.php
+ array_push($mysql_changes,
+'define(\'PWG_CHARSET\', \''.$pwg_charset.'\');
define(\'DB_CHARSET\', \''.$db_charset.'\');
-define(\'DB_COLLATE\', \'\');
-'.substr($config_file_contents, $php_end_tag);
-
- $fp = @fopen( $config_file, 'w' );
- @fputs($fp, $config_file_contents, strlen($config_file_contents));
- @fclose($fp);
+define(\'DB_COLLATE\', \'\');'
+ );
foreach ($all_langs as $old_lang=>$lang_data)
{
diff --git a/install/upgrade_1.3.1.php b/install/upgrade_1.3.1.php
index 436f25953..fa7708f6a 100644
--- a/install/upgrade_1.3.1.php
+++ b/install/upgrade_1.3.1.php
@@ -595,15 +595,8 @@ if (!is_writable($config_file))
die('FILE NOT WRITABLE '.$config_file);
}
-// Insert define('PHPWG_INSTALLED', true); in mysql.inc.php
-$config_file_contents =
- substr($config_file_contents, 0, $php_end_tag).'
-define(\'PHPWG_INSTALLED\', true);
-'.substr($config_file_contents, $php_end_tag);
-
-$fp = @fopen( $config_file, 'w' );
-@fputs($fp, $config_file_contents, strlen($config_file_contents));
-@fclose($fp);
+// changes to write in mysql.inc.php
+array_push($mysql_changes, 'define(\'PHPWG_INSTALLED\', true);');
// Send infos
$page['infos'] = array_merge(