aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamil Staps2015-02-06 10:59:54 +0100
committerCamil Staps2015-02-06 10:59:54 +0100
commit1dbc789375ed20415ea03d1744a76a8ef68a8033 (patch)
treee30e227afea178d0d3134c927bf29e5b81c08e94
parentAdded gitignore for files directory (diff)
Updated information about installing folders
-rw-r--r--README.md4
-rw-r--r--install/index.php10
2 files changed, 13 insertions, 1 deletions
diff --git a/README.md b/README.md
index b223295..a010ea9 100644
--- a/README.md
+++ b/README.md
@@ -53,10 +53,12 @@ In classes/constants.php, you should at least set the following options:
* `url_internal`: the same URL, without the domain part
-## Create the database tables
+## Create database tables and files folder
Open up /install/index.php. When you click 'create tables', it will create all the necessary tables in the database. This is also a first check to see if your MySQL credentials are valid.
+In the same file, click 'create folders'. This will create your files and trash folder. This is also a check to make sure that your permissions are correct. You can also create these folders yourself, if you make sure the webserver has permission to it.
+
## Permissions
The files folder will be used to put generated invoices in. Make your server user (usually `www-data`) full permissions to this folder.
diff --git a/install/index.php b/install/index.php
index 5d6b7fa..afa7b9b 100644
--- a/install/index.php
+++ b/install/index.php
@@ -98,6 +98,15 @@ if (isset($_GET['create_tables'])) {
}
}
+
+if (isset($_GET['create_folders'])) {
+ if (!mkdir(constants::files_folder)) {
+ echo "Creating folder `" . constants::files_folder . "` failed.<br/>";
+ }
+ if (!mkdir(constants::files_folder . constants::files_folder_trash)) {
+ echo "Creating folder `" . constants::files_folder_trash . "` failed.<br/>";
+ }
+}
?>
<hr/>
@@ -106,6 +115,7 @@ if (isset($_GET['create_tables'])) {
<ol>
<li><a href="?create_tables">Create database tables</a></li>
+ <li><a href="?create_folders">Create folders</a></li>
</ol>
<p>When you're done, it would be the neatest to remove the /install folder (even though this whole control panel should not be accessible for the public).</p> \ No newline at end of file