diff options
author | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-06-13 08:11:09 +0000 |
---|---|---|
committer | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-06-13 08:11:09 +0000 |
commit | 4b5756ba9d8ee9e83c1ba4624b461b4746e49e82 (patch) | |
tree | 2e46772da9d25197fd847b273ca1f9b882ad3e34 /lib/debug.lib.php | |
parent | 93f4a26ab07207e1f9a8e716a82c5d8812d5344c (diff) | |
download | ampache-4b5756ba9d8ee9e83c1ba4624b461b4746e49e82.tar.gz ampache-4b5756ba9d8ee9e83c1ba4624b461b4746e49e82.tar.bz2 ampache-4b5756ba9d8ee9e83c1ba4624b461b4746e49e82.zip |
Miscellaneous cleanup.
Diffstat (limited to 'lib/debug.lib.php')
-rw-r--r-- | lib/debug.lib.php | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/lib/debug.lib.php b/lib/debug.lib.php index 9347fed2..4464447e 100644 --- a/lib/debug.lib.php +++ b/lib/debug.lib.php @@ -163,20 +163,20 @@ function check_php_pcre() { function check_config_values($conf) { if (!$conf['database_hostname']) { - return false; - } - if (!$conf['database_name']) { - return false; - } - if (!$conf['database_username']) { - return false; - } - if (!$conf['database_password']) { - return false; - } - if (!$conf['session_length']) { - return false; - } + return false; + } + if (!$conf['database_name']) { + return false; + } + if (!$conf['database_username']) { + return false; + } + if (!$conf['database_password']) { + return false; + } + if (!$conf['session_length']) { + return false; + } if (!$conf['session_name']) { return false; } @@ -192,7 +192,7 @@ function check_config_values($conf) { } } - return true; + return true; } // check_config_values @@ -311,35 +311,35 @@ function generate_config($current) { /* Start building the new config file */ $distfile = Config::get('prefix') . '/config/ampache.cfg.php.dist'; - $handle = fopen($distfile,'r'); - $dist = fread($handle,filesize($distfile)); - fclose($handle); + $handle = fopen($distfile,'r'); + $dist = fread($handle,filesize($distfile)); + fclose($handle); - $data = explode("\n",$dist); + $data = explode("\n",$dist); - /* Run throught the lines and set our settings */ - foreach ($data as $line) { + /* Run throught the lines and set our settings */ + foreach ($data as $line) { - /* Attempt to pull out Key */ - if (preg_match("/^;?([\w\d]+)\s+=\s+[\"]{1}(.*?)[\"]{1}$/",$line,$matches) + /* Attempt to pull out Key */ + if (preg_match("/^;?([\w\d]+)\s+=\s+[\"]{1}(.*?)[\"]{1}$/",$line,$matches) || preg_match("/^;?([\w\d]+)\s+=\s+[\']{1}(.*?)[\']{1}$/", $line, $matches) - || preg_match("/^;?([\w\d]+)\s+=\s+[\'\"]{0}(.*)[\'\"]{0}$/",$line,$matches)) { + || preg_match("/^;?([\w\d]+)\s+=\s+[\'\"]{0}(.*)[\'\"]{0}$/",$line,$matches)) { $key = $matches[1]; - $value = $matches[2]; + $value = $matches[2]; - /* Put in the current value */ + /* Put in the current value */ if ($key == 'config_version') { $line = $key . ' = ' . $value; } - elseif (isset($current[$key])) { - $line = $key . ' = "' . $current[$key] . '"'; - unset($current[$key]); + elseif (isset($current[$key])) { + $line = $key . ' = "' . $current[$key] . '"'; + unset($current[$key]); } // if set } // if key - $final .= $line . "\n"; + $final .= $line . "\n"; } // end foreach line |