aboutsummaryrefslogtreecommitdiffstats
path: root/storage-backend/lib/functions.filetransfer.inc.php
diff options
context:
space:
mode:
authorroot <root@fucktheforce.de>2017-05-03 09:58:22 +0200
committerroot <root@fucktheforce.de>2017-05-03 09:58:22 +0200
commit732fc99a23364a525c428c279173abd460065488 (patch)
treebd23c6e8d73338a51e8f167df51e0a74f52366d9 /storage-backend/lib/functions.filetransfer.inc.php
parent9827ec6d450b71ade7c19740b46274fff6fbc682 (diff)
parentbcfe8b2d97520e699377b41a1e024185fc7813dc (diff)
Merge branch 'master' of http://git.fucktheforce.de/cgi-bin/git/httpupload
Diffstat (limited to 'storage-backend/lib/functions.filetransfer.inc.php')
-rw-r--r--storage-backend/lib/functions.filetransfer.inc.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/storage-backend/lib/functions.filetransfer.inc.php b/storage-backend/lib/functions.filetransfer.inc.php
new file mode 100644
index 0000000..679cef1
--- /dev/null
+++ b/storage-backend/lib/functions.filetransfer.inc.php
@@ -0,0 +1,23 @@
+<?php
+/*
+ * This file contains the functions for the storage-backend.
+ */
+
+function getSlotFilePath($slotUUID, $config) {
+ return $config['slot_registry_dir'].$slotUUID;
+}
+
+function getUploadFilePath($slotUUID, $config, $filename = NULL) {
+ $path = $config['storage_base_path'].$slotUUID;
+ if (!is_null($filename)) {
+ $path .= '/'.$filename;
+ }
+ return $path;
+}
+
+function loadSlotParameters($slotUUID, $config) {
+ $slotParameters = require(getSlotFilePath($slotUUID, $config));
+ $slotParameters['filename'] = $slotParameters['filename'];
+
+ return $slotParameters;
+} \ No newline at end of file