summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoehm2014-09-17 00:16:08 +0200
committermoehm2014-09-17 00:16:08 +0200
commit548e11e863e906bb80695fe7b2789fe4af3f0f39 (patch)
treebfaf74580a8e524ad37132161ef3dc0238ec2f94
downloadvfs-548e11e863e906bb80695fe7b2789fe4af3f0f39.tar.gz
init
-rw-r--r--files/PLACEHOLDER1
-rw-r--r--public_html/class/mysql.php28
-rw-r--r--public_html/index.php3
-rw-r--r--public_html/vfs_config.php28
4 files changed, 60 insertions, 0 deletions
diff --git a/files/PLACEHOLDER b/files/PLACEHOLDER
new file mode 100644
index 0000000..a979f67
--- /dev/null
+++ b/files/PLACEHOLDER
@@ -0,0 +1 @@
+Placeholder for Git
diff --git a/public_html/class/mysql.php b/public_html/class/mysql.php
new file mode 100644
index 0000000..b2d2983
--- /dev/null
+++ b/public_html/class/mysql.php
@@ -0,0 +1,28 @@
+<?php
+
+class database {
+
+ public $db;
+ private $dbhost;
+ private $dbuser;
+ private $dbpassword;
+ private $dbname;
+ private $dbprefix;
+
+ public function __construct($dbhost, $dbuser, $dbname, $dbpassword, $dbprefix){
+ $this->dbhost=$dbhost;
+ $this->dbuser=$dbuser;
+ $this->dbname=$dbname;
+ $this->dbpassword=$dbpassword;
+ $this->dbprefix=$dbprefix;
+ }
+
+ public function open(){
+ try {
+ $this->db = new mysqli($this->dbhost, $this->dbuser, $this->dbpassword, $this->dbname);
+ } catch (Exception $e){
+ echo $e->getMessage();
+ exit;
+ }
+ }
+}
diff --git a/public_html/index.php b/public_html/index.php
new file mode 100644
index 0000000..5d705b8
--- /dev/null
+++ b/public_html/index.php
@@ -0,0 +1,3 @@
+<?php
+
+require('./vfs_config.php');
diff --git a/public_html/vfs_config.php b/public_html/vfs_config.php
new file mode 100644
index 0000000..141345c
--- /dev/null
+++ b/public_html/vfs_config.php
@@ -0,0 +1,28 @@
+<?php
+
+# mysql access
+define('DBHOST', 'localhost');
+define('DBUSER', 'vfs-user');
+define('DBNAME', 'vfs');
+define('DBPASSWORD', 'secretpassword');
+define('DBPREFIX', 'vfs_');
+
+# absolute path
+define('ABSPATH', dirname(__FILE__));
+
+# file directory
+define('FILEPATH', ABSPATH . '/../files');
+
+# scheme, set to http if set, otherwise plain http
+if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')
+ define('SCHEME', 'https://');
+else
+ define('SCHEME', 'http://');
+
+# hostname
+define('HOST', $_SERVER['HTTP_HOST']);
+define('DOMAIN', SCHEME . HOST);
+
+# redis access
+define('REDIS_DBNAME', 1);
+define('REDIS_CONNECT', '/var/run/redis/redis.sock');