summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-04-21 03:21:20 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-04-21 03:21:20 +0000
commit310adfa35923938b97ea416cd21c431d64eaa05a (patch)
tree245aba68464905bdb5d0072918aa0f5b621290cb /lib
parent67981be0c675d0685bc6e986e6cf5e5fb6cae611 (diff)
downloadampache-310adfa35923938b97ea416cd21c431d64eaa05a.tar.gz
ampache-310adfa35923938b97ea416cd21c431d64eaa05a.tar.bz2
ampache-310adfa35923938b97ea416cd21c431d64eaa05a.zip
last commit before beta3 release
Diffstat (limited to 'lib')
-rw-r--r--lib/class/album.class.php2
-rw-r--r--lib/class/catalog.class.php2
-rw-r--r--lib/class/dba.class.php13
-rw-r--r--lib/init.php4
-rw-r--r--lib/install.php14
5 files changed, 28 insertions, 7 deletions
diff --git a/lib/class/album.class.php b/lib/class/album.class.php
index 713b8a0a..ae96e61e 100644
--- a/lib/class/album.class.php
+++ b/lib/class/album.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2008 Ampache.org
+ Copyright (c) Ampache.org
All Rights Reserved
This program is free software; you can redistribute it and/or
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index 2ec23dea..311697cf 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2007 Ampache.org
+ Copyright (c) Ampache.org
All Rights Reserved
This program is free software; you can redistribute it and/or
diff --git a/lib/class/dba.class.php b/lib/class/dba.class.php
index 71e6b6c8..e9d0304d 100644
--- a/lib/class/dba.class.php
+++ b/lib/class/dba.class.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2008 Ampache.org
+ Copyright (c) Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
@@ -130,6 +130,17 @@ class Dba {
} // num_rows
/**
+ * finish
+ * This closes a result handle and clears the memory assoicated with it
+ */
+ public static function finish($resource) {
+
+ // Clear the result memory
+ mysql_free_result($resource);
+
+ } // finish
+
+ /**
* affected_rows
* This emulates the mysql_affected_rows function
*/
diff --git a/lib/init.php b/lib/init.php
index 58d846db..f68c3eb7 100644
--- a/lib/init.php
+++ b/lib/init.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2008 Ampache.org
+ Copyright (c) Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
@@ -81,7 +81,7 @@ if (!count($results)) {
}
/** This is the version.... fluf nothing more... **/
-$results['version'] = '3.4-Beta3 Build (001)';
+$results['version'] = '3.4-Beta3';
$results['int_config_version'] = '6';
$results['raw_web_path'] = $results['web_path'];
diff --git a/lib/install.php b/lib/install.php
index 6bfc2f6f..ae873a46 100644
--- a/lib/install.php
+++ b/lib/install.php
@@ -136,14 +136,24 @@ function install_insert_db($username,$password,$hostname,$database) {
Error::add('general','Error: Database Already exists and Overwrite not checked');
return false;
}
- if (!$db_selected) {
- $sql = "CREATE DATABASE `" . $database . "`";
+ elseif (!$db_selected) {
+ $sql = "CREATE DATABASE `" . Dba::escape($database) . "`";
if (!$db_results = @mysql_query($sql, $dbh)) {
Error::add('general',"Error: Unable to Create Database " . mysql_error());
return false;
}
@mysql_select_db($database, $dbh);
} // if db can't be selected
+ else {
+ $sql = "DROP DATABASE `" . Dba::escape($database) . "`";
+ $db_results = @mysql_query($sql,$dbh);
+ $sql = "CREATE DATABASE `" . Dba::escape($database) . "`";
+ if (!$db_results = @mysql_query($sql, $dbh)) {
+ Error::add('general',"Error: Unable to Create Database " . mysql_error());
+ return false;
+ }
+ @mysql_select_db($database, $dbh);
+ } // end if selected and overwrite
/* Check and see if we should create a user here */
if ($_REQUEST['db_user'] == 'create_db_user') {