From 58b18bff0f08daa482c7949e1487ffccf00463a5 Mon Sep 17 00:00:00 2001 From: plegall Date: Mon, 22 Aug 2011 17:14:13 +0000 Subject: feature 2413 added: move gallery_url configuration parameter from database to local configuration file. git-svn-id: http://piwigo.org/svn/trunk@11978 68402e56-0260-453c-a942-63ccdbb3a9ee --- install/db/110-database.php | 117 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 install/db/110-database.php (limited to 'install') diff --git a/install/db/110-database.php b/install/db/110-database.php new file mode 100644 index 000000000..968735e73 --- /dev/null +++ b/install/db/110-database.php @@ -0,0 +1,117 @@ +"; + } + else + { + // we have to update the local conf + $config_file_contents = @file_get_contents($local_conf); + if ($config_file_contents === false) + { + $error = 'Cannot load '.$local_conf.', add by hand: '.$conf_line; + + array_push($page['errors'], $error); + echo $error; + } + else + { + $php_end_tag = strrpos($config_file_contents, '?'.'>'); + if ($php_end_tag === false) + { + // the file is empty + $config_file_contents_new = ""; + } + else + { + $config_file_contents_new = + substr($config_file_contents, 0, $php_end_tag) . "\n" + .$conf_line."\n" + .substr($config_file_contents, $php_end_tag) + ; + } + } + } + + if (isset($config_file_contents_new)) + { + if (!@file_put_contents($local_conf, $config_file_contents_new)) + { + $error = 'Cannot write into local configuration file '.$local_conf.', add by hand: '.$conf_line; + + array_push($page['errors'], $error); + echo $error; + } + } +} + +$query = ' +DELETE + FROM '.CONFIG_TABLE.' + WHERE param =\'gallery_url\' +;'; +pwg_query($query); + +echo +"\n" +. $upgrade_description +."\n" +; +?> \ No newline at end of file -- cgit v1.2.3