diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-05-13 09:00:22 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-05-13 09:00:22 +0000 |
commit | dccdeba838129a5a3805c7669ec0a6328269f738 (patch) | |
tree | c0be99c6f36c6d32330ae304a3d13e84a783dfb4 /lib | |
parent | 1e9f582cf1dba653f45bbc5835fa662a3c163e69 (diff) | |
download | ampache-dccdeba838129a5a3805c7669ec0a6328269f738.tar.gz ampache-dccdeba838129a5a3805c7669ec0a6328269f738.tar.bz2 ampache-dccdeba838129a5a3805c7669ec0a6328269f738.zip |
first step of installer works, will finish later tomorrow morning
Diffstat (limited to 'lib')
-rw-r--r-- | lib/debug.lib.php | 13 | ||||
-rw-r--r-- | lib/general.lib.php | 2 | ||||
-rw-r--r-- | lib/install.php | 37 |
3 files changed, 21 insertions, 31 deletions
diff --git a/lib/debug.lib.php b/lib/debug.lib.php index 10ad838f..69825c68 100644 --- a/lib/debug.lib.php +++ b/lib/debug.lib.php @@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2006 Ampache.org + Copyright (c) 2001 - 2007 Ampache.org All rights reserved. This program is free software; you can redistribute it and/or @@ -28,12 +28,11 @@ * connections, web paths etc.. */ -/*! - @function check_database - @discussion checks the local mysql db - and make sure life is good -*/ -function check_database($host,$username,$pass,$database) { +/** + * check_database + * checks the local mysql db and make sure life is good + */ +function check_database($host,$username,$pass) { $dbh = @mysql_connect($host, $username, $pass); diff --git a/lib/general.lib.php b/lib/general.lib.php index ff641e6f..c9283f08 100644 --- a/lib/general.lib.php +++ b/lib/general.lib.php @@ -343,7 +343,7 @@ function get_random_songs( $options, $matchlist) { $albums_where .= " OR song.album=" . $data[0]; } $albums_where = ltrim($albums_where," OR"); - $query = "SELECT song.id,song.size,song.time FROM song WHERE $albums_where ORDER BY song.track ASC"; + $query = "SELECT song.id,song.size,song.time FROM song WHERE $albums_where ORDER BY song.album,song.track ASC"; } elseif ($options['random_type'] == 'full_artist') { $query = "SELECT artist.id FROM song,artist WHERE song.artist=artist.id AND $where GROUP BY song.artist ORDER BY RAND() " . $limit_sql; diff --git a/lib/install.php b/lib/install.php index 0efdeaa7..4bf47b11 100644 --- a/lib/install.php +++ b/lib/install.php @@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2006 Ampache.org + Copyright (c) 2001 - 2007 Ampache.org All rights reserved. This program is free software; you can redistribute it and/or @@ -19,17 +19,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*! - @header Install docuement - @discussion this document contains the functions needed to see if - ampache needs to be installed -*/ -/*! - @function split_sql - @discussion splits up a standard SQL dump file into distinct - sql queryies -*/ +/** + * split_sql + * splits up a standard SQL dump file into distinct + * sql queryies + */ function split_sql($sql) { $sql = trim($sql); $sql = ereg_replace("\n#[^\n]*\n", "\n", $sql); @@ -59,13 +54,12 @@ function split_sql($sql) { return($ret); } // split_sql -/*! - @function install_check_status() - @discussion this function checks to see if we actually - still need to install ampache. This function is - very important, we don't want to reinstall over top - of an existing install -*/ +/** + * install_check_status + * this function checks to see if we actually + * still need to install ampache. This function is + * very important, we don't want to reinstall over top of an existing install + */ function install_check_status($configfile) { /* @@ -81,11 +75,10 @@ function install_check_status($configfile) { Check and see if they've got _any_ account if they don't then they're cool */ - $results = read_config($GLOBALS['configfile'], 0, 0); - $dbh = check_database($results['local_host'],$results['local_username'],$results['local_pass']); + $results = parse_ini_file($GLOBALS['configfile']); + $dbh = check_database($results['database_hostname'],$results['database_username'],$results['database_password']); if (is_resource($dbh)) { - $db_select = mysql_select_db($results['local_db'],$dbh); $sql = "SELECT * FROM user"; $db_results = @mysql_query($sql, $dbh); @@ -94,8 +87,6 @@ function install_check_status($configfile) { } } - - /* Defaut to no */ return false; |