summaryrefslogtreecommitdiffstats
path: root/install.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-05-13 21:37:49 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-05-13 21:37:49 +0000
commit779f4bf4e560d7f415ea51a96ed547831745a8dc (patch)
treec99f06687da016d975b3e131ff2d57a8b68da0dd /install.php
parent1a6ae62569dbc5603a361a488641950cc317ac3d (diff)
downloadampache-779f4bf4e560d7f415ea51a96ed547831745a8dc.tar.gz
ampache-779f4bf4e560d7f415ea51a96ed547831745a8dc.tar.bz2
ampache-779f4bf4e560d7f415ea51a96ed547831745a8dc.zip
updated sql file, and the install process now works
Diffstat (limited to 'install.php')
-rw-r--r--install.php64
1 files changed, 26 insertions, 38 deletions
diff --git a/install.php b/install.php
index 5d24d352..8b07d76c 100644
--- a/install.php
+++ b/install.php
@@ -41,6 +41,8 @@ $prefix = dirname(__FILE__);
Config::set('prefix',$prefix,'1');
$configfile = "$prefix/config/ampache.cfg.php";
+set_error_handler('ampache_error_handler');
+
/* First things first we must be sure that they actually still need to
install ampache
*/
@@ -51,6 +53,7 @@ if (!install_check_status($configfile)) {
// Define that we are doing an install so the includes will work
define('INSTALL','1');
+define('INIT_LOADED','1');
/* Clean up incomming variables */
$web_path = scrub_in($_REQUEST['web_path']);
@@ -66,7 +69,7 @@ $php_self = $http_type . $_SERVER['HTTP_HOST'] . "/" . preg_replace("/^\/(.+\.ph
switch ($_REQUEST['action']) {
case 'create_db':
if (!install_insert_db($username,$password,$hostname,$database)) {
- require_once('templates/show_install.inc');
+ require_once 'templates/show_install.inc';
break;
}
@@ -76,12 +79,12 @@ switch ($_REQUEST['action']) {
header ("Location: " . $php_self . "?action=show_create_config&local_db=$database&local_host=$hostname&htmllang=$htmllang&charset=$charset");
- break;
+ break;
case 'create_config':
$created_config = install_create_config($web_path,$username,$password,$hostname,$database);
- require_once('templates/show_install_config.inc');
- break;
+ require_once 'templates/show_install_config.inc';
+ break;
case 'show_create_config':
/* Attempt to Guess the Web_path */
@@ -93,7 +96,7 @@ switch ($_REQUEST['action']) {
$charset = $_REQUEST['charset'];
// Set the lang in the conf array
- conf(array('lang'=>$htmllang));
+ Config::set('lang',$htmllang,'1');
// We need the charset for the different languages
$charsets = array('de_DE' => 'ISO-8859-15',
@@ -108,60 +111,47 @@ switch ($_REQUEST['action']) {
$charset = $charsets[$_REQUEST['htmllang']];
// Set the site_charset in the conf array
- conf(array('site_charset'=>$charsets[$_REQUEST['htmllang']]));
+ Config::set('site_charset',$charsets[$_REQUEST['htmllang']],'1');
/* load_gettext mojo */
load_gettext();
- header ("Content-Type: text/html; charset=" . conf('site_charset'));
+ header ("Content-Type: text/html; charset=" . Config::get('site_charset'));
- require_once('templates/show_install_config.inc');
- break;
+ require_once 'templates/show_install_config.inc';
+ break;
case 'create_account':
+
+ $results = parse_ini_file($configfile);
+ Config::set_by_array($results,'1');
+
if (!install_create_account($username,$password)) {
- require_once('templates/show_install_account.inc.php');
+ require_once Config::get('prefix') . '/templates/show_install_account.inc.php';
break;
}
- $results = read_config($configfile, 0, 0);
- $results['mysql_hostname'] = $results['local_host'];
- $results['mysql_username'] = $results['local_username'];
- $results['mysql_password'] = $results['local_pass'];
- $results['mysql_db'] = $results['local_db'];
-
if ($_SERVER['HTTPS'] == 'on') { $http_type = "https://"; }
else { $http_type = "http://"; }
- vauth_conf($results);
- /* Setup Preferences */
- $temp_user = new User($username);
- $temp_user->fix_preferences();
- $temp_user = new User(-1);
- $temp_user->username = '-1';
- $temp_user->fix_preferences();
-
-
$web_path = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path'];
header ("Location: " . $web_path . "/login.php");
-
+ break;
case 'show_create_account':
- $results = read_config($configfile, 0, 0);
-
+ $results = parse_ini_file($configfile);
+
/* Make sure we've got a valid config file */
- if (!read_config_file($configfile) OR !check_config_values($results)) {
- require_once('templates/show_install_config.inc');
+ if (!check_config_values($results)) {
+ require_once Config::get('prefix') . '/templates/show_install_config.inc';
break;
}
-
/* Get the variables for the language */
$htmllang = $_REQUEST['htmllang'];
$charset = $_REQUEST['charset'];
-
// Set the lang in the conf array
- conf(array('lang'=>$htmllang));
+ Config::set('lang',$htmllang,'1');
// We need the charset for the different languages
$charsets = array('de_DE' => 'ISO-8859-15',
@@ -176,13 +166,13 @@ switch ($_REQUEST['action']) {
$charset = $charsets[$_REQUEST['htmllang']];
// Set the site_charset in the conf array
- conf(array('site_charset'=>$charsets[$_REQUEST['htmllang']]));
+ Config::set('site_charset',$charsets[$_REQUEST['htmllang']],'1');
/* load_gettext mojo */
load_gettext();
- header ("Content-Type: text/html; charset=" . conf('site_charset'));
+ header ("Content-Type: text/html; charset=" . Config::get('site_charset'));
- require_once('templates/show_install_account.inc.php');
+ require_once Config::get('prefix') . '/templates/show_install_account.inc.php';
break;
case 'init':
/* First step of installation */
@@ -224,8 +214,6 @@ switch ($_REQUEST['action']) {
/* Show the language options first */
require_once 'templates/show_install_lang.inc.php';
break;
-
} // end action switch
-
?>