diff --git a/setup/xampp.php b/setup/xampp.php index 34cf385ea0..ba0d4b70c9 100644 --- a/setup/xampp.php +++ b/setup/xampp.php @@ -1,115 +1,138 @@ - +?> -

Sorry, the attempt to connect to the host has failed. MySQL reports the following error -

+

Sorry, the attempt to connect to the host has failed. MySQL reports the following error -

- +}else{ -

Sorry, the attempt to create the database to the database has failed. MySQL reports the following error -

+?> - Sorry, the attempt to create the database to the database has failed. MySQL reports the following error -

- $query = "USE toolkits_data"; + +}else{ -

Sorry, the attempt to specify which database we need to work on (the MySQL keyword - USE) has failed. MySQL reports the following error - "; ?>

+?> - Sorry, the attempt to specify which database we need to work on (the MySQL keyword - USE) has failed. MySQL reports the following error - "; ?>

- $temp = explode(";",file_get_contents("basic.sql")); + -

Sorry, The query has failed. MySQL reports the following error -

+ }else{ - +

Sorry, The query has failed. MySQL reports the following error -

- } + +if($query_response){ -

Sorry, The query has failed. MySQL reports the following error -

- - /* - * Create the database - */ +

Sorry, The query has failed. MySQL reports the following error -

- $buffer = file_get_contents("xampp_database.txt"); - $file_handle = fopen("../database.php",'w'); - fwrite($file_handle,$buffer,strlen($buffer)); - fclose($file_handle); + +if(!is_writeable('../index.php')) { + echo "Check your file permissions, index.php file is not writeable by the web server; you will want to replace index.php with demo.txt"; +} +if(is_file('../index.php') && is_writeable('../index.php')) { + @copy("../index.php","../index.txt"); + if(copy("../demo.txt","../index.php")) { + echo "

Login requirement removed; using demo.txt as index.php page (index.php -> index.txt && demo.txt -> index.php).

"; + } +} -

- Toolkits has been installed.

Please go to http://localhost/xertetoolkits/ -

-

- Please see the Xerte site at http://www.nottingham.ac.uk/xerte and please consider joining the mailing list. -

+// update DB so it should work on Windows and OSX installs - rather than being hard coded to WAMP installs... +$site_url = 'http://' . $_SERVER['HTTP_HOST'] . dirname(dirname($_SERVER['REQUEST_URI'])); + +$db_site_url = mysql_real_escape_string($site_url); +mysql_query("UPDATE sitedetails SET site_url = '$db_site_url/' WHERE site_id = 1"); + +$home = realpath(dirname(dirname(__FILE__))); +$db_root_file_path = mysql_real_escape_string($home); +$db_import_path = mysql_real_escape_string($home . DIRECTORY_SEPARATOR . 'import' . DIRECTORY_SEPARATOR); +mysql_query("UPDATE sitedetails SET root_file_path = '$db_root_file_path/' WHERE site_id = 1"); +mysql_query("UPDATE sitedetails SET import_path = '$db_import_path/' WHERE site_id = 1"); + +?> +

+ Toolkits has been installed.

Please go to

+

+ Please see the Xerte site at http://www.nottingham.ac.uk/xerte and please consider joining the mailing list. +

- \ No newline at end of file +