summaryrefslogtreecommitdiffstats
path: root/bin/migrate_config.inc
diff options
context:
space:
mode:
Diffstat (limited to 'bin/migrate_config.inc')
-rw-r--r--bin/migrate_config.inc84
1 files changed, 42 insertions, 42 deletions
diff --git a/bin/migrate_config.inc b/bin/migrate_config.inc
index 8589cada..ee1316be 100644
--- a/bin/migrate_config.inc
+++ b/bin/migrate_config.inc
@@ -1,5 +1,5 @@
<?php
-/* vim:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
+/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
@@ -23,23 +23,23 @@
define('NO_SESSION','1');
$unmigratable = array('auth_methods'=>'mysql',
- 'tag_order'=>'id3v2,id3v1,vorbiscomment,quicktime,ape,asf',
- 'album_art_order'=>'db,id3,folder,lastfm,amazon',
- 'amazon_base_urls'=>'http://webservices.amazon.com');
+ 'tag_order'=>'id3v2,id3v1,vorbiscomment,quicktime,ape,asf',
+ 'album_art_order'=>'db,id3,folder,lastfm,amazon',
+ 'amazon_base_urls'=>'http://webservices.amazon.com');
$translate = array('local_host'=>'database_hostname',
- 'local_db'=>'database_name',
- 'local_username'=>'database_username',
- 'local_pass'=>'database_password',
- 'local_length'=>'session_length',
- 'stream_cmd_flac'=>'transcode_cmd_flac',
- 'stream_cmd_mp3'=>'transcode_cmd_mp3',
- 'stream_cmd_m4a'=>'transcode_cmd_m4a',
- 'stream_cmd_ogg'=>'transcode_cmd_ogg',
- 'stream_cmd_mpc'=>'transcode_cmd_mpc',
- 'sess_name'=>'session_name',
- 'sess_cookielife'=>'session_cookielife',
- 'sess_cookiesecure'=>'session_cookiesecure');
+ 'local_db'=>'database_name',
+ 'local_username'=>'database_username',
+ 'local_pass'=>'database_password',
+ 'local_length'=>'session_length',
+ 'stream_cmd_flac'=>'transcode_cmd_flac',
+ 'stream_cmd_mp3'=>'transcode_cmd_mp3',
+ 'stream_cmd_m4a'=>'transcode_cmd_m4a',
+ 'stream_cmd_ogg'=>'transcode_cmd_ogg',
+ 'stream_cmd_mpc'=>'transcode_cmd_mpc',
+ 'sess_name'=>'session_name',
+ 'sess_cookielife'=>'session_cookielife',
+ 'sess_cookiesecure'=>'session_cookiesecure');
$path = dirname(__FILE__);
$prefix = realpath($path . '/../');
@@ -52,28 +52,28 @@ echo "\n";
foreach ($data as $line) {
- // Replace a # with ;
- if ($line['0'] == '#') {
- $line = substr_replace($line,";",0,1);
- }
-
- foreach ($unmigratable as $option=>$default) {
- if (strstr($line,$option) AND !$migrated[$option]) {
- $line = $option . " = \"$default\"";
- $migrated[$option] = true;
- }
- elseif (strstr($line,$option)) {
- $line = ';' . $line;
- }
- }
-
- foreach ($translate as $old=>$new) {
- if (strstr($line,$old)) {
- $line = str_replace($old,$new,$line);
- }
- }
-
- $new_config .= $line . "\n";
+ // Replace a # with ;
+ if ($line['0'] == '#') {
+ $line = substr_replace($line,";",0,1);
+ }
+
+ foreach ($unmigratable as $option=>$default) {
+ if (strstr($line,$option) AND !$migrated[$option]) {
+ $line = $option . " = \"$default\"";
+ $migrated[$option] = true;
+ }
+ elseif (strstr($line,$option)) {
+ $line = ';' . $line;
+ }
+ }
+
+ foreach ($translate as $old=>$new) {
+ if (strstr($line,$old)) {
+ $line = str_replace($old,$new,$line);
+ }
+ }
+
+ $new_config .= $line . "\n";
} // end foreach lines
@@ -85,12 +85,12 @@ $handle = fopen($prefix . '/config/ampache.cfg.php','w');
$worked = fwrite($handle,$new_config);
if ($worked) {
- echo T_("Write success, config migrated");
- echo "\n";
+ echo T_("Write success, config migrated");
+ echo "\n";
}
else {
- echo T_("Access Denied, config migration failed");
- echo "\n";
+ echo T_("Access Denied, config migration failed");
+ echo "\n";
}
?>