summaryrefslogtreecommitdiffstats
path: root/bin/migrate_config.inc
diff options
context:
space:
mode:
authormomo-i <momo-i@ampache>2009-11-24 00:45:47 +0000
committermomo-i <momo-i@ampache>2009-11-24 00:45:47 +0000
commitc796c76f764209199cad39644abdc66cd926ef71 (patch)
tree71d8746660033fac83207e378b298ca8dcf8942d /bin/migrate_config.inc
parentef21e122d1c55d03ce346e58d907b98313fcecfa (diff)
downloadampache-c796c76f764209199cad39644abdc66cd926ef71.tar.gz
ampache-c796c76f764209199cad39644abdc66cd926ef71.tar.bz2
ampache-c796c76f764209199cad39644abdc66cd926ef71.zip
Update localization
Diffstat (limited to 'bin/migrate_config.inc')
-rw-r--r--bin/migrate_config.inc85
1 files changed, 44 insertions, 41 deletions
diff --git a/bin/migrate_config.inc b/bin/migrate_config.inc
index 4bc381d6..7e88774b 100644
--- a/bin/migrate_config.inc
+++ b/bin/migrate_config.inc
@@ -39,53 +39,56 @@ $translate = array('local_host'=>'database_hostname',
'sess_cookielife'=>'session_cookielife',
'sess_cookiesecure'=>'session_cookiesecure');
-$path = dirname(__FILE__);
-$prefix = realpath($path . '/../');
-$old_config = file_get_contents($prefix . '/config/ampache.cfg.php');
-
-$data = explode("\n",$old_config);
-
-echo "Parsing old config file...\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";
+$path = dirname(__FILE__);
+$prefix = realpath($path . '/../');
+$old_config = file_get_contents($prefix . '/config/ampache.cfg.php');
-} // end foreach lines
+$data = explode("\n",$old_config);
+
+echo _("Parsing old config file...");
+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";
+
+} // end foreach lines
-echo "Parse complete, writing\n";
+echo _("Parse complete, writing");
+echo "\n";
$handle = fopen($prefix . '/config/ampache.cfg.php','w');
-$worked = fwrite($handle,$new_config);
+$worked = fwrite($handle,$new_config);
-if ($worked) {
- echo "Write success, config migrated\n";
-}
-else {
- echo "Access Denied, config migration failed\n";
-}
+if ($worked) {
+ echo _("Write success, config migrated");
+ echo "\n";
+}
+else {
+ echo _("Access Denied, config migration failed");
+ echo "\n";
+}
?>