aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2012-01-06 02:03:22 +0100
committerKevin Chabowski <kevin@kch42.de>2012-01-06 02:03:22 +0100
commitb1cc0b2980b2875848eb4a1ee3b9d957ce3b3632 (patch)
tree30f244c66dfbb5be73d6ef7c4ff186e46031f9a0
parent9f0dc74fc89f89fed7e10dd027d14830cb97e7e2 (diff)
downloadr7r-repo-b1cc0b2980b2875848eb4a1ee3b9d957ce3b3632.tar.gz
r7r-repo-b1cc0b2980b2875848eb4a1ee3b9d957ce3b3632.tar.bz2
r7r-repo-b1cc0b2980b2875848eb4a1ee3b9d957ce3b3632.zip
Improved setup and added INSTALL file.
-rw-r--r--INSTALL40
-rw-r--r--r7r_repo/config.php12
-rw-r--r--r7r_repo/main.php10
3 files changed, 51 insertions, 11 deletions
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..6991140
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,40 @@
+How to install r7r_repo
+=======================
+
+1. Open the file 'r7r_repo/config.php' with a text editor.
+ Replace
+ define("CONFIG_FILLED_OUT", False);
+ with
+ define("CONFIG_FILLED_OUT", True);
+ and fill in your MySQL connection details.
+
+ Example:
+ Let's say your MySQL server is 'localhost' (it is almost always 'localhost'), the database is called 'cool_db', your user is 'sqluser' and it's password is 'mypassword'. And you want the database prefix to be 'repo_'. Then your config file should look like this:
+
+ <?php
+
+ define("CONFIG_FILLED_OUT", True);
+ define("SKIP_TABLE_CREATION", False);
+
+ $config["mysql"]["server"] = "localhost";
+ $config["mysql"]["db"] = "cool_db";
+ $config["mysql"]["user"] = "sqluser";
+ $config["mysql"]["passwd"] = "mypassword";
+ $config["mysql"]["prefix"] = "repo_";
+
+ ?>
+
+2. Upload everything to your webhost.
+
+3. Go to the location of your new repo in your favorite web browser.
+ The installation dialog will automatically show up. If there is an error about missing writing permissions, change the permissions of the listed files, so your webserver can write them. If you do not know the user / group of your webserver (usually somethng like 'apache', 'nobody' or 'httpd') you can also give everyone writing permissions. Keep in mind that this might be an security issue on multiuser systems.
+
+ If there is no error message, just type in the details needed by the setup process and hit submit.
+
+4. Your new r7r_repo installation should now be ready to go. But to increase performance, you should make a last modification to config.php:
+ Replace
+ define("SKIP_TABLE_CREATION", False);
+ with
+ define("SKIP_TABLE_CREATION", True);
+
+5. There is no step 5 :-)
diff --git a/r7r_repo/config.php b/r7r_repo/config.php
index 7a05f24..5fde543 100644
--- a/r7r_repo/config.php
+++ b/r7r_repo/config.php
@@ -1,12 +1,12 @@
<?php
-define("CONFIG_FILLED_OUT", True);
+define("CONFIG_FILLED_OUT", False);
define("SKIP_TABLE_CREATION", False);
-$config["mysql"]["server"] = "localhost";
-$config["mysql"]["db"] = "s_db_47";
-$config["mysql"]["user"] = "dbuser_47";
-$config["mysql"]["passwd"] = "DfXVQBoVOBPbLlL";
-$config["mysql"]["prefix"] = "repo_";
+$config["mysql"]["server"] = "";
+$config["mysql"]["db"] = "";
+$config["mysql"]["user"] = "";
+$config["mysql"]["passwd"] = "";
+$config["mysql"]["prefix"] = "";
?>
diff --git a/r7r_repo/main.php b/r7r_repo/main.php
index d2497f0..cd62825 100644
--- a/r7r_repo/main.php
+++ b/r7r_repo/main.php
@@ -530,7 +530,7 @@ $url_handlers = array(
$url_next = array();
/* Test file permissions */
- $permissions_missing = array_filter(array("/packages", "/packagelist", "/repometa"), function($f) { return !@is_writable(dirname(__FILE__) . "/..$f"); });
+ $permissions_missing = array_filter(array("/packages", "/packagelist", "/repometa", "/r7r_repo/templates/transc"), function($f) { return !@is_writable(dirname(__FILE__) . "/..$f"); });
if(!empty($permissions_missing))
$ste->vars["error"] = "No writing permissions on these files/directories: \"" . implode("\", \"", $permissions_missing) . "\"";
else
@@ -576,16 +576,16 @@ $ste->vars["rel_path_to_root"] = $rel_path_to_root;
/* Enforce setup */
if(!@$settings["setup_finished"])
$urlpath = array("setup");
-/*try
-{*/
+try
+{
url_process($urlpath, $url_handlers, $data);
-/*}
+}
catch(Exception $e)
{
header("HTTP/1.1 500 Internal Server Error");
header("Content-Type: text/plain");
echo "Internal Server Error\nReason: " . get_class($e) . "(" . $e->getMessage() . ") thrown.\n";
-}*/
+}
/* save settings */
$settings->save();